Wodahskcin Posted August 18, 2011 Posted August 18, 2011 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) expandcollapse popup;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
monoscout999 Posted August 18, 2011 Posted August 18, 2011 (edited) Read the forum rules... Forum RulesEDIT: We don`t talk about Games automation here. Edited August 18, 2011 by monoscout999
Wodahskcin Posted August 18, 2011 Author Posted August 18, 2011 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.
monoscout999 Posted August 18, 2011 Posted August 18, 2011 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
Recommended Posts