JamesDover Posted December 29, 2007 Posted December 29, 2007 I have been playing wow for sometime and find myself tired of hammering the keys to cast a spell. I have tried to make a script but it only sends the key and then sleeps. The problem is when a enemy is pounding on me it interrupts the spell then moves on to the next spell. So what I am shooting for is a script that will send the key then something like a while <> wend which the spell will keep casting until it is done. Thanks $Spell4 = PixelSearch($CastbarX, $CastbarY, $CastbarX, $CastbarY, $CastbarC, 5) If not @error Then While $Spell4 <> $castingbarGone Send($Spell4Key, 1) Wend EndIf This is what I have this far i'm trying to plan it out before I build it.
martin Posted December 29, 2007 Posted December 29, 2007 I have been playing wow for sometime and find myself tired of hammering the keys to cast a spell. I have tried to make a script but it only sends the key and then sleeps. The problem is when a enemy is pounding on me it interrupts the spell then moves on to the next spell. So what I am shooting for is a script that will send the key then something like a while <> wend which the spell will keep casting until it is done. Thanks $Spell4 = PixelSearch($CastbarX, $CastbarY, $CastbarX, $CastbarY, $CastbarC, 5) If not @error Then While $Spell4 <> $castingbarGone Send($Spell4Key, 1) Wend EndIf This is what I have this far i'm trying to plan it out before I build it. Looks like this is in the wrong forum, but while you're here that won't work. Once the script gets into the while/wend loop it will never get out again. You need to add a line to update the current value of spell, ie a repeat of the first line. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
tttommeke Posted December 31, 2007 Posted December 31, 2007 Don't do it trough the pixelsearch but trough memory, their is an address that will show what spell you are casting.
galpha Posted December 31, 2007 Posted December 31, 2007 Don't do it trough the pixelsearch but trough memory, their is an address that will show what spell you are casting.Was just gonna say that There's a value that changes to 0 or 1 when you're casting. Do a memory read every 10 or so milliseconds, and if the value = 0, then send a key.Currently at work and tttomeke's site is down the the current's patch addresses, so can't post it right now. Will do when I get home if you want.
GlebCheboxarian Posted January 2, 2008 Posted January 2, 2008 I wish this be a new topic but somehow I can't create one. So, everybody questions "How can I send a keystroke to inactive window with no wincontrols and keep it inactive?" Solution: $char = "x" $hwnd = WinGetHandle ("World of Warcraft"); or YOURS window title DllCall("user32.dll", "int", "SendMessage", "hwnd", $hwnd, "lparam", $WM_SETFOCUS, "lparam", 0, "lparam", 0) DllCall("user32.dll", "int", "PostMessage", "hwnd", $hwnd, "lparam", $WM_KEYDOWN, "lparam", Asc($char), "lparam", 0) DllCall("user32.dll", "int", "PostMessage", "hwnd", $hwnd, "lparam", $WM_KEYUP, "lparam", Asc($char), "lparam", 0) DllCall("user32.dll", "int", "SendMessage", "hwnd", $hwnd, "lparam", $WM_KILLFOCUS, "lparam", 0, "lparam", 0) note the WM_SETFOCUS / WM_KILLFOCUS messages. It's simple, my poor-minded friends.
GlebCheboxarian Posted January 2, 2008 Posted January 2, 2008 can't you just do control send? To do a control send you need a control in the window. Some applications (like WoW) just don't register standart ones, handling all the input by themselves.
Pithikos Posted January 3, 2008 Posted January 3, 2008 I wish this be a new topic but somehow I can't create one. So, everybody questions "How can I send a keystroke to inactive window with no wincontrols and keep it inactive?" Solution: $char = "x" $hwnd = WinGetHandle ("World of Warcraft"); or YOURS window title DllCall("user32.dll", "int", "SendMessage", "hwnd", $hwnd, "lparam", $WM_SETFOCUS, "lparam", 0, "lparam", 0) DllCall("user32.dll", "int", "PostMessage", "hwnd", $hwnd, "lparam", $WM_KEYDOWN, "lparam", Asc($char), "lparam", 0) DllCall("user32.dll", "int", "PostMessage", "hwnd", $hwnd, "lparam", $WM_KEYUP, "lparam", Asc($char), "lparam", 0) DllCall("user32.dll", "int", "SendMessage", "hwnd", $hwnd, "lparam", $WM_KILLFOCUS, "lparam", 0, "lparam", 0) note the WM_SETFOCUS / WM_KILLFOCUS messages. It's simple, my poor-minded friends. Well tried that but it says i have to declare $WM_SETFOCUS and so on but I don't even know what they are
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now