Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Help with this script..


  • Please log in to reply
6 replies to this topic
Leila
  • Members
  • 6 posts
  • Last active: Oct 20 2004 07:32 AM
  • Joined: 03 May 2004
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 ;)

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
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.

Leila
  • Members
  • 6 posts
  • Last active: Oct 20 2004 07:32 AM
  • Joined: 03 May 2004
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

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
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:
#z::
FileAppend, {F2}, M:\KeyToPress.txt
return
A 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.
}


Leila
  • Members
  • 6 posts
  • Last active: Oct 20 2004 07:32 AM
  • Joined: 03 May 2004
just GORGEOUS!.. Exellent!
thankk youu very much!! :)

Leila
  • Members
  • 6 posts
  • Last active: Oct 20 2004 07:32 AM
  • Joined: 03 May 2004
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

Leila
  • Members
  • 6 posts
  • Last active: Oct 20 2004 07:32 AM
  • Joined: 03 May 2004
reeeeeeeady . dont bother. i fixed it! :)
y put labels.. and add goto label2.. instead of continue..
thx :)
kiiiiiiiiiiiiiiiiiiiiiiiiiiiis!
and goodbye!