Sign in to follow this  
Followers 0
bb05

My first Auto-it proggie :)

9 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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 ;)

Share this post


Link to post
Share on other sites

instead of typing out the entire window title (eg: GTA: San Andreas) is there a way to just have it search for part of text in a title (eg: GTA:) or something similar to that?

Share this post


Link to post
Share on other sites

Use opt("WinTitleMatchMode",2)


My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! you’re the best in town Fight!

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Share this post


Link to post
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?

Share this post


Link to post
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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0