Jump to content

My first Auto-it proggie :)


bb05
 Share

Recommended Posts

ok i know this is really not the greatest app in the world.. but hey I get lazy when i play san andreas and typing in cheats for it.

here's my code so far of what i've got:

HotkeySet("{END}","_end")
HotkeySet("{HOME}","cheat")
While 1
    WinActivate("GTA: San Andreas")
    Sleep(100)
    WEnd
Func _end()
Exit 0
EndFunc
Func cheat()
Send("uzumymw")
Sleep(200)
Send("hesoyam")
Sleep(200)
EndFunc
Exit

it runs and cheats work, im just curious if anyone would have done it differently. i did a little searching through the help file but found this the easiest way for me to get it working :shocked:

comments appreciated.

bb05

edit: I am curious, would there be a way to autoactivate a window from a variable:

eg: a screen that has GTA in the title, instead of having to type out the whole wintitle for WinActivate.

2nd edit:

is there an easy way to find out what the keys are on the keyboard:

i know {HOME} represents the home key but how would i find out what every key's value is for in autoit? (dont need to know letters or numbers, got that part figured out :( ) Looking to figure out like the F-Keys, tabs, caps lock, etc.

thanks again :P

Edited by bb05
Link to comment
Share on other sites

ok i know this is really not the greatest app in the world.. but hey I get lazy when i play san andreas and typing in cheats for it.

here's my code so far of what i've got:

HotkeySet("{END}","_end")
HotkeySet("{HOME}","cheat")
While 1
    WinActivate("GTA: San Andreas")
    Sleep(100)
    WEnd
Func _end()
Exit 0
EndFunc
Func cheat()
Send("uzumymw")
Sleep(200)
Send("hesoyam")
Sleep(200)
EndFunc
Exit

it runs and cheats work, im just curious if anyone would have done it differently. i did a little searching through the help file but found this the easiest way for me to get it working :shocked:

comments appreciated.

bb05

edit: I am curious, would there be a way to autoactivate a window from a variable:

eg: a screen that has GTA in the title, instead of having to type out the whole wintitle for WinActivate.

thanks again :(

Looks great :P What do you mean by autoactivate a window from a variable? Im not sure thats all ;)
Link to comment
Share on other sites

Lets say your gta window is named GTA: San Andreas v.1.14

With code under $wintitle will now be "GTA: San Andreas v.1.14"

$wintitle = 'GTA'
$wintitle = WinGetTitle($wintitle)
UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
Link to comment
Share on other sites

Lets say your gta window is named GTA: San Andreas v.1.14

With code under $wintitle will now be "GTA: San Andreas v.1.14"

$wintitle = 'GTA'
$wintitle = WinGetTitle($wintitle)

shouldnt

$wintitle = WinGetTitle($wintitle)

be

WinActivate($wintitle) ?

sorry for my ignorance :shocked:

edit:

so this is what i have now as my code:

HotkeySet("{END}","_end")
HotkeySet("{HOME}","cheat")
While 1
    $wintitle = 'GTA'
    $wintitle = WinGetTitle($wintitle)
    WinActivate($wintitle)
    Sleep(100)
    WEnd
Func _end()
Exit 0
EndFunc
Func cheat()
Send("uzumymw")
Sleep(200)
Send("hesoyam")
EndFunc
Exit
Edited by bb05
Link to comment
Share on other sites

Opt("WinTitleMatchMode",2)

HotKeySet("{END}", "_Exit")
HotKeySet("{HOME}", "Cheat")

WinActivate("GTA")

While 1
    Sleep(0xFFFFFF)
WEnd

Func _Exit()
    Exit 0
EndFunc   ;==>_Exit

Func Cheat()
    Send("uzumymw")
    Sleep(200)
    Send("hesoyam")
    Sleep(200)
EndFunc   ;==>Cheat

Just minor details..

Link to comment
Share on other sites

Ok, I understand everything that you did (and note that it looks great) but what exactly what does this do?

Sleep(0xFFFFFF)

I know its a delay but i thought you had to have a number in there for delaying?

Link to comment
Share on other sites

Ok, I understand everything that you did (and note that it looks great) but what exactly what does this do?

Sleep(0xFFFFFF)

I know its a delay but i thought you had to have a number in there for delaying?

0xFFFFFF is actually a number, only in another number system than the more familiar Decimal system, it's in Hexadecimal (meaning 16-based instead of 10-based). See for instance: http://en.wikipedia.org/wiki/Hexadecimal

So FFFFFF is 16777215. Sleep(0xFFFFFF) is just a quick&dirty easy way of telling the script to pause for a very long time (amounts to about 4.6 hours if I calculated correctly).

:shocked:

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...