Jump to content

Run a While loop more than once, THEN activate other code...


 Share

Recommended Posts

Alright, I'll admit right now, this is for a game only because they banned me, so I thought I'd get back at them in a small about way...

My first problem is just a organized neat phobia of mine...

While 1
                
                                Send("{F9}");<------- Start of Repeat section
                Sleep(500)
                Send("bot1")
                Sleep(600)
                Send("{ENTER}")
                Sleep(5000)
                Attack()
                Send("{F9}")
                Sleep(500)
                Send("bot2")
                Sleep(500)
                Send("{ENTER}")
                Sleep(16000)
                Sleep(300)
                Send("{F9}")
                Sleep(500)
                Send("bot3")
                Sleep(500)
                Send("{ENTER}")
                Sleep(30000)
                Send("{F9}")
                Sleep(1000)
                Send("bot4")
                Sleep(500)
                Send("{ENTER}")
                Sleep(185000)
                Attack()
                Sleep(800)
                Send("{F9}")
                Sleep(500)
                Send("bot5")
                Sleep(500)
                Send("{ENTER}")
                Sleep(48000)
                Timber()
                Sleep(7000)
                Timber()
                Sleep(8000)
                Send("{F9}")
                Sleep(1000)
                Send("bot6")
                Sleep(500)
                Send("{ENTER}")
                Sleep(70000);<---------- End of Repeat Section  (Continues down script)
                                Send("{F9}")
                Sleep(500)
                Send("bot1")
                Sleep(600)
                Send("{ENTER}")
                Sleep(5000)
                Attack()
                Send("{F9}")
                Sleep(500)
                Send("bot2")
                Sleep(500)
                Send("{ENTER}")
                Sleep(16000)
                Sleep(300)
                Send("{F9}")
                Sleep(500)
                Send("bot3")
                Sleep(500)
                Send("{ENTER}")
                Sleep(30000)
                Send("{F9}")
                Sleep(1000)
                Send("bot4")
                Sleep(500)
                Send("{ENTER}")
                Sleep(185000)
                Attack()
                Sleep(800)
                Send("{F9}")
                Sleep(500)
                Send("bot5")
                Sleep(500)
                Send("{ENTER}")
                Sleep(48000)
                Timber()
                Sleep(7000)
                Timber()
                Sleep(8000)
                Send("{F9}")
                Sleep(1000)
                Send("bot6")
                Sleep(500)
                Send("{ENTER}")
                Sleep(70000)
                                Send("{F9}")
                Sleep(500)
                Send("bot1")
                Sleep(600)
                Send("{ENTER}")
                Sleep(5000)
                Attack()
                Send("{F9}")
                Sleep(500)
                Send("bot2")
                Sleep(500)
                Send("{ENTER}")
                Sleep(16000)
                Sleep(300)
                Send("{F9}")
                Sleep(500)
                Send("bot3")
                Sleep(500)
                Send("{ENTER}")
                Sleep(30000)
                Send("{F9}")
                Sleep(1000)
                Send("bot4")
                Sleep(500)
                Send("{ENTER}")
                Sleep(185000)
                Attack()
                Sleep(800)
                Send("{F9}")
                Sleep(500)
                Send("bot5")
                Sleep(500)
                Send("{ENTER}")
                Sleep(48000)
                Timber()
                Sleep(7000)
                Timber()
                Sleep(8000)
                Send("{F9}")
                Sleep(1000)
                Send("bot6")
                Sleep(500)
                Send("{ENTER}")
                Sleep(70000)
                                Send("{F9}")
                Sleep(500)
                Send("bot1")
                Sleep(600)
                Send("{ENTER}")
                Sleep(5000)
                Attack()
                Send("{F9}")
                Sleep(500)
                Send("bot2")
                Sleep(500)
                Send("{ENTER}")
                Sleep(16000)
                Sleep(300)
                Send("{F9}")
                Sleep(500)
                Send("bot3")
                Sleep(500)
                Send("{ENTER}")
                Sleep(30000)
                Send("{F9}")
                Sleep(1000)
                Send("bot4")
                Sleep(500)
                Send("{ENTER}")
                Sleep(185000)
                Attack()
                Sleep(800)
                Send("{F9}")
                Sleep(500)
                Send("bot5")
                Sleep(500)
                Send("{ENTER}")
                Sleep(48000)
                Timber()
                Sleep(7000)
                Timber()
                Sleep(8000)
                Send("{F9}")
                Sleep(1000)
                Send("bot6")
                Sleep(500)
                Send("{ENTER}")
                Sleep(70000)
                
        ;<------- Add new coding to do once every 4 times, then go back to the 4 time cycle.
                
            WEnd

I want to turn ALL that into a time deal... If you notice, I pointed out where it repeats itself, and I'd like to have the repeated section down to ONE section and then once that section has repeated (4 times), it will do a different step, THEN go back to the original, and cycle all the way back through. I don't know how else to word it to make it more understandable, sorry for that.

Diagram of how I want it: [Run ;<-- Start Repeat through ;<-- End Repeat 4 times, then run a different task, after that different task is done, repeat the Run ;<-- Start Repeat through ;<-- End Repeat 4 times]

2nd Problem: I cannot grasp the Pixel Search idea.

As stated in the help file

PixelSearch ( left, top, right, bottom, color [, shade-variation] [, step]] )

What I cannot understand is the 'left, top, right, bottom' comes in at... WHERE do I get these values... Is Left the x coord and y the right? But then What is Top/Bottom.... A noob question, but yet I cannot understand it :P.

3rd I have not updated myself with AutoIt and its newer technology in quite some time... I have AutoIt3 for about... [a long time]... From what I can remember, you could not ControlClick with a PixelSearch correct? Has this changed? *What I'm talking about is for it to search in background window for a certain color, and click that color (still in background, can't see it happening) and continue working in background view....?*

4th: Has the AutoIt Macro recorder changed at all with newer versions... Mine doesn't write down the delays, which makes it basically useless to me :(.

Last one (for now :idea:): Is there anyway I can Run a task on this gay game so that it keeps clicking a certain position, and the whole time it is clicking, it it constantly searching for the ground color to change? What I'm trying to accomplish is to have it continually talk to this one guy and he gives you a riddle and you have 4 answers to choose from... I want the bot to spam one answer over and over (new question each time you guess wrong), and when you get right, you go to a completely different ground colored place, and at THAT point, I want it to stop spamming the answer and continue on with the script...

Well holy crip-a-crapple I wrote a lot and I respect you for not answering this cause I'm making it to cheat a game and for the fact theres a gajillion words to read... Any help is much welcomed and I thank you for it.

My coding, if it helps... Very messy, took codes from here and there from when I was a noob (which I still am xD)

#include <GuiConstants.au3>
Opt("GUIOnEventMode",1)
HotKeySet("{F5}", "_Start")
HotKeySet("{ESC}","Terminate")
HotKeySet("^p", "_ToggleRun")

Global $Running = 0, $MPos, $PixelColor

$ClickIt = 0
GUICreate("bottest", 400, 300)
GUISetOnEvent($GUI_EVENT_CLOSE,"Terminate")
$Checkbox_1 = GUICtrlCreateCheckbox("bot", 20, 40, 150, 20)
GUISetState()
While 1
    Sleep( 10 )
WEnd
Exit




Func Pot()
    If $PixelColor <> PixelGetColor($MPos[0], $MPos[1]) Then
        Send("{F4}")
        Sleep(1000)
    EndIf
EndFunc

Func _ToggleRun()
    $Running = NOT $Running
    If $Running Then
        $MPos = MouseGetPos()
        $PixelColor = PixelGetColor($MPos[0], $MPos[1])
    EndIf
EndFunc

Func Timber()
    $Coords=PixelSearch(200,100,825,600,9189376,5)
    If NOT @error Then
        MouseClick("left",$Coords[0],$Coords[1],1,0)
        Sleep(2000)
        MouseClick("left", 95, 320)
    EndIf
EndFunc


Func Attack()
    $Coords=PixelSearch(200,100,825,600,16746083,5)
    If NOT @error Then
        MouseClick("left",$Coords[0],$Coords[1],1,0)
        Sleep(2000)
        MouseClick("left",$Coords[0],$Coords[1],1,0)
        Sleep(900)
    EndIf
EndFunc

Func _Start ()
    $ClickIt = 1
    While $ClickIt = 1
        If BitAND(GUICtrlRead($Checkbox_1), $GUI_CHECKED) = $GUI_CHECKED Then
            
            While 1
                Send("{F9}")
                Sleep(500)
                Send("bot1")
                Sleep(600)
                Send("{ENTER}")
                Sleep(5000)
                Attack()
                Send("{F9}")
                Sleep(500)
                Send("bot2")
                Sleep(500)
                Send("{ENTER}")
                Sleep(16000)
                Sleep(300)
                Send("{F9}")
                Sleep(500)
                Send("bot3")
                Sleep(500)
                Send("{ENTER}")
                Sleep(30000)
                Send("{F9}")
                Sleep(1000)
                Send("bot4")
                Sleep(500)
                Send("{ENTER}")
                Sleep(185000)
                Attack()
                Sleep(800)
                Send("{F9}")
                Sleep(500)
                Send("bot5")
                Sleep(500)
                Send("{ENTER}")
                Sleep(48000)
                Timber()
                Sleep(7000)
                Timber()
                Sleep(8000)
                Send("{F9}")
                Sleep(1000)
                Send("bot6")
                Sleep(500)
                Send("{ENTER}")
                Sleep(70000)
                                Send("{F9}")
                Sleep(500)
                Send("bot1")
                Sleep(600)
                Send("{ENTER}")
                Sleep(5000)
                Attack()
                Send("{F9}")
                Sleep(500)
                Send("bot2")
                Sleep(500)
                Send("{ENTER}")
                Sleep(16000)
                Sleep(300)
                Send("{F9}")
                Sleep(500)
                Send("bot3")
                Sleep(500)
                Send("{ENTER}")
                Sleep(30000)
                Send("{F9}")
                Sleep(1000)
                Send("bot4")
                Sleep(500)
                Send("{ENTER}")
                Sleep(185000)
                Attack()
                Sleep(800)
                Send("{F9}")
                Sleep(500)
                Send("bot5")
                Sleep(500)
                Send("{ENTER}")
                Sleep(48000)
                Timber()
                Sleep(7000)
                Timber()
                Sleep(8000)
                Send("{F9}")
                Sleep(1000)
                Send("bot6")
                Sleep(500)
                Send("{ENTER}")
                Sleep(70000)
                                Send("{F9}")
                Sleep(500)
                Send("bot1")
                Sleep(600)
                Send("{ENTER}")
                Sleep(5000)
                Attack()
                Send("{F9}")
                Sleep(500)
                Send("bot2")
                Sleep(500)
                Send("{ENTER}")
                Sleep(16000)
                Sleep(300)
                Send("{F9}")
                Sleep(500)
                Send("bot3")
                Sleep(500)
                Send("{ENTER}")
                Sleep(30000)
                Send("{F9}")
                Sleep(1000)
                Send("bot4")
                Sleep(500)
                Send("{ENTER}")
                Sleep(185000)
                Attack()
                Sleep(800)
                Send("{F9}")
                Sleep(500)
                Send("bot5")
                Sleep(500)
                Send("{ENTER}")
                Sleep(48000)
                Timber()
                Sleep(7000)
                Timber()
                Sleep(8000)
                Send("{F9}")
                Sleep(1000)
                Send("bot6")
                Sleep(500)
                Send("{ENTER}")
                Sleep(70000)
                                Send("{F9}")
                Sleep(500)
                Send("bot1")
                Sleep(600)
                Send("{ENTER}")
                Sleep(5000)
                Attack()
                Send("{F9}")
                Sleep(500)
                Send("bot2")
                Sleep(500)
                Send("{ENTER}")
                Sleep(16000)
                Sleep(300)
                Send("{F9}")
                Sleep(500)
                Send("bot3")
                Sleep(500)
                Send("{ENTER}")
                Sleep(30000)
                Send("{F9}")
                Sleep(1000)
                Send("bot4")
                Sleep(500)
                Send("{ENTER}")
                Sleep(185000)
                Attack()
                Sleep(800)
                Send("{F9}")
                Sleep(500)
                Send("bot5")
                Sleep(500)
                Send("{ENTER}")
                Sleep(48000)
                Timber()
                Sleep(7000)
                Timber()
                Sleep(8000)
                Send("{F9}")
                Sleep(1000)
                Send("bot6")
                Sleep(500)
                Send("{ENTER}")
                Sleep(70000)
                
                
                
            WEnd
        EndIf
    WEnd


EndFunc;==>_Start
Func Terminate ()
    Exit
EndFunc;==>Terminate

On a last note, I got help with the Global thing from a friend who's way better than me in AutoIt... I don't really understand why it's there and what it does... If you get through my 5135234 questions, this is my last one to be answered lol.

Thanks a bunch.

Edited by BuddyBoy
Link to comment
Share on other sites

Alright, I'll admit right now, this is for a game only because they banned me, so I thought I'd get back at them in a small about way...

Neither the purpose nor the attitude are appreciated on this forum.

No soup for you!

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Neither the purpose nor the attitude are appreciated on this forum.

No soup for you!

:P

As I said at the bottom, I know you guys aren't into the whole 'bot for games -AutoIts only use!'... I understand that, I just want help where I can get it, if you guys can't help I guess I have no purpose in programming in AutoIt as I can't increase my knowledge of it no longer without some guidance... Hopefully SOMEONE will help me out here. :S

Link to comment
Share on other sites

As I said at the bottom, I know you guys aren't into the whole 'bot for games -AutoIts only use!'... I understand that

What's that got to do with using AutoIt to "get back at" a site that banned you?

I just want help where I can get it, if you guys can't help I guess I have no purpose in programming in AutoIt as I can't increase my knowledge of it no longer without some guidance...

You're right, go find another language, you wouldn't like AutoIt very much... :P

Hopefully SOMEONE will help me out here. :S

I hope not.

:(

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

What's that got to do with using AutoIt to "get back at" a site that banned you?

You're right, go find another language, you wouldn't like AutoIt very much... :P

I hope not.

:(

You aren't comprehending what I'm saying... rawr... I said: I would APPRECIATE if some master-coder would step outside their boundaries to help me make this bot come true so I can have a sense of satisfaction when the game as to invent a way to beat my bot.

And actually, I like AutoIt intensely, I've tried AutoHotKey and other programs below the advanced stages (C, C++, etc) and this is the I chose, for a reason.

And I do not why you have to be so stubborn to keep posting, I know your one of the head-honchos among these forums and people will let you rule them like as if your Hitler, but I'm asking, as a user of this program, do either butt out, or help out :)

Time to go eat my chicken noodle soup (Yes, there is soup for me :idea:) I hope when I get back I can get someone who actually will help instead of criticize.

Edited by BuddyBoy
Link to comment
Share on other sites

Actually the fact that you're making this just to get back at a site is pretty immature. Bots are allowed for discussion but they have to have a good purpose; play the game, pick up dropped items, find hidden items etc. A spam bot really just pisses people off so I doubt you'll get much help.

Link to comment
Share on other sites

Actually the fact that you're making this just to get back at a site is pretty immature. Bots are allowed for discussion but they have to have a good purpose; play the game, pick up dropped items, find hidden items etc. A spam bot really just pisses people off so I doubt you'll get much help.

No no no, this isn't a spam bot... This is WAY more than 'play the game, pick up dropped items, find hidden items'... This is a bot that makes 'house permits' which can be sold in-game for quite a bit, as they take HOURS upon HOURS to make. Though the game has made it beyond difficult to move my way throughout the game without running into obstacles... I'm not some noob downloading aimbots and 'pooning' everyone... I simply want to make them realize I'm not a force to be reckoned with... I guess... xD

Looks like I'm not gonna receive any help here after all. I know problems 1-4 that I asked would take some of you a total of 5 minutes max to do, yet you refuse to.

If this matters, the game will have my bot patched along with many other bots I have made for it within days... Just recently since I got banned, I have a new vendetta to get back at them.

Link to comment
Share on other sites

That's why we won't help. Most of your questions really would take roughly 5 minutes to solve but we aren't going to help with a vendetta. If you want to learn read the helpfile.

Link to comment
Share on other sites

That's why we won't help. Most of your questions really would take roughly 5 minutes to solve but we aren't going to help with a vendetta. If you want to learn read the helpfile.

The helpfile with the pixel search tells me... well what I wrote there... It does NOTHING to explain in-depth what left, top, right, bottom actually ARE...

I suppose since you guys are too simple-minded, I ask for one favor... Just tell me what the left, top, right, bottom actually means and how I can get these values...

Link to comment
Share on other sites

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...