Jump to content
Sign in to follow this  
Wodahskcin

If problem.

Recommended Posts

Wodahskcin

Alright so, i started making this bot for a game called MTA. its just a simple bot, but what im trying to do is make it so autoit will switch from whatever im doing at the time, to mta, run the little bot, then switch back to what im doing, now i have that done. Except i also want it so if im watching a movie in windows media player,to switch to that and make it full screen again.

I"m an alright programmer I just dont know autoit code so feel free to use advanced terms ill understand you. Here is my code so far (Its just thrown together then ive been adding on to it if i find osmething to add)

;Option 1
while 1
$window1 = WinGetTitle("")
blockinput (1)
WinActivate("MTA: San Andreas","")
Send("{w down}")
Sleep(600)
Send("{w up}")
Sleep(50)
Send("{d down}")
Sleep(600)
Send("{d up}")
Sleep(50)
Send("{s down}")
Sleep(600)
Send("{s up}")
Sleep(50)
Send("{a down}")
Sleep(600)
Send("{a up}")
Sleep(200)
MouseClick("left",550,340,1)
Sleep(100)
MouseClick("left",581,474,1)
Sleep(100)
WinSetState ( "MTA: San Andreas", "", @SW_MINIMIZE)
WinActivate($window1,"")
if $window1 = "Windows Media Player" then
MouseClick("left",581,474,1)
MouseClick("left",581,474,1)
Else    
EndIf
blockinput (0)
Sleep(125000)
$window2 = WinGetTitle("")
;Option 2
blockinput (1)
WinActivate("MTA: San Andreas","")
Send("{w down}")
Sleep(600)
Send("{w up}")
Sleep(50)
Send("{d down}")
Sleep(600)
Send("{d up}")
Sleep(50)
Send("{s down}")
Sleep(600)
Send("{s up}")
Sleep(50)
Send("{a down}")
Sleep(600)
Send("{a up}")
Sleep(200)
MouseClick("left",549,366,1)
Sleep(100)
MouseClick("left",581,474,1)
Sleep(100)
WinSetState ( "MTA: San Andreas", "", @SW_MINIMIZE)
WinActivate($window2,"")
if $window2 = "Windows Media Player" then
MouseClick("left",581,474,1)
MouseClick("left",581,474,1)
Else    
EndIf
blockinput (0)
Sleep(125000)
wend

What the bot does is move my character in a circle then selects an option then goes back to w/e. But it switches between 2 options each time (if i could shorten this code with if statements it would be awesome)

But yeah basically my problem is making the if statement work. cause it appears as though it doesnt even pick up the window1/2 variables as windows media player.

thanks alot,

~wodahskcin

Share this post


Link to post
Share on other sites
monoscout999

Read the forum rules... Forum Rules

EDIT: We don`t talk about Games automation here.

Edited by monoscout999

Share this post


Link to post
Share on other sites
Wodahskcin

Ah sorry about that, just read the rules when registering, had a feeling there were rules against talking about that. If this post could be deleted that would be great.

Once again sorry for breaking the rules with my first post haha.

Share this post


Link to post
Share on other sites
monoscout999

no problem... welcome to the forum, and if you have any other question... just post it in a new thread, becasue this will be colsed :mellow:

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×