Hi. im new on this..
I want to do a simple script.. but i don't know how ;(...
the script is something like this:
for example.. when someone write on MSN window the word "HI" I want my computer press F2.. how can i do this?..
(Actually this isn't for Msn window.. it is for a GAME)..
I hope you can help me.
thanks
Help with this script..
Started by
Leila
, May 03 2004 01:13 PM
6 replies to this topic
#1
-
Posted 03 May 2004 - 01:13 PM
Although most games show their text as graphics, you can try to use Window Spy or WinGetText with your game to see if it contains any text. If it doesn't, the only way to respond to what's on the screen is to use PixelGetColor and PixelSearch.
To help with building a game automation script, here's a simple hotkey that gets the color and coordinates at the pixel where the mouse is pointing in a full screen game:
#z::
MouseGetPos, X, Y
; Move the cursor out of the way so that it doesn't block the pixel we
; want. Move the mouse slowly so that the game can keep up with it:
MouseMove, 0, 0, 3
PixelGetColor, color, %X%, %Y%
MouseMove, %X%, %Y%, 1 ; moving faster seems ok in this case
clipboard = %clipboard%`nX%X% Y%Y% Color = %color%
return
Each time you press Win+z, a new pixel color will be appended to the clipboard.
To help with building a game automation script, here's a simple hotkey that gets the color and coordinates at the pixel where the mouse is pointing in a full screen game:
#z::
MouseGetPos, X, Y
; Move the cursor out of the way so that it doesn't block the pixel we
; want. Move the mouse slowly so that the game can keep up with it:
MouseMove, 0, 0, 3
PixelGetColor, color, %X%, %Y%
MouseMove, %X%, %Y%, 1 ; moving faster seems ok in this case
clipboard = %clipboard%`nX%X% Y%Y% Color = %color%
return
Each time you press Win+z, a new pixel color will be appended to the clipboard.
#2
-
Posted 03 May 2004 - 01:26 PM
I really apreciated your help cmallet... maybe I didnt express myself so clearly... (i dont speak english very well)...
anyway...the problem is...
I have to keep the Mouse Cursor still, cause I won't be using that computer... that cause i want that script.. cause I won't have to be sitting in that computer.. i want to handle the game from another Computer.. whispering that CHARACTER.. for example..
I whisper to that character and i say to him "press f2".. and the carachater has to press that key...
so if u have any ideas .. pleeeeeeeeease!
thx again cmallet!
kiss
anyway...the problem is...
I have to keep the Mouse Cursor still, cause I won't be using that computer... that cause i want that script.. cause I won't have to be sitting in that computer.. i want to handle the game from another Computer.. whispering that CHARACTER.. for example..
I whisper to that character and i say to him "press f2".. and the carachater has to press that key...
so if u have any ideas .. pleeeeeeeeease!
thx again cmallet!
kiss
#3
-
Posted 03 May 2004 - 01:57 PM
If the computers are networked, there are probably several ways to control one from the other. One of the simplest ways is with a mapped drive.
Let's say that your computer has a drive M: that is a mapped drive on the remote computer. If you create a file of a certain name on the remote computer (using FileAppend), that remote computer can watch for the file (using IfExist) and press a key. So it might work like this:
A script on your computer:
Let's say that your computer has a drive M: that is a mapped drive on the remote computer. If you create a file of a certain name on the remote computer (using FileAppend), that remote computer can watch for the file (using IfExist) and press a key. So it might work like this:
A script on your computer:
#z:: FileAppend, {F2}, M:\KeyToPress.txt returnA script on the remote computer:
Loop { IfNotExist, C:\KeyToPress.txt { Sleep, 10 continue ; Start a new loop iteration. } ; Otherwise: FileReadLine, line, C:\KeyToPress.txt, 1 Send, %line% ; line should contain {F2} in this example FileDelete, C:\KeyToPress.txt ; Reset for the next time. }
#4
-
Posted 03 May 2004 - 02:13 PM
One moreee questionn.. im sorry for beeing so heavy...
cma... the script works exeeelent... but i want to repeeat this.. i mean.. with 2 more keys.. so what i did?.. i repeat de script 2 more times.. and i changed the file names... the files created succefully on my drive "M:".. but the remote script doesn't work good.. what i have to do to repeat this actions for 2 more keys?... thx!
kiss
cma... the script works exeeelent... but i want to repeeat this.. i mean.. with 2 more keys.. so what i did?.. i repeat de script 2 more times.. and i changed the file names... the files created succefully on my drive "M:".. but the remote script doesn't work good.. what i have to do to repeat this actions for 2 more keys?... thx!
kiss
#6
-
Posted 03 May 2004 - 07:55 PM
reeeeeeeady . dont bother. i fixed it!
y put labels.. and add goto label2.. instead of continue..
thx
kiiiiiiiiiiiiiiiiiiiiiiiiiiiis!
and goodbye!
y put labels.. and add goto label2.. instead of continue..
thx
kiiiiiiiiiiiiiiiiiiiiiiiiiiiis!
and goodbye!
#7
-
Posted 03 May 2004 - 08:11 PM