Jump to content

Novice script looking for advice


Recommended Posts

Hello there! I'm currently in the process of coming up with a nice AV (Alterac Valley) AFK bot for those who have other things to do with their time. (Sleep maybe!)

What you need to do before starting the script:

  • Download and install the SSpvp 2 mod
  • Run wow
  • Go to Silvermoon (GG alliance.)
  • Go to the AV battlemaster
  • Look directly to the Battlemaster's right and stand on a circle on the carpet.
  • Now point your camera down and zoom all the way out.
  • You're good to go!

Now here's what the current script does...

  • It will first click in this random area that I have chosen it is a small rectangle / square that's over the Battlemaster. There are random sleep times between mousemoves and clicks to make it more random. (Ty for all the useful info on this site to make it undectable.)
  • SSpvp 2 will auto Q just by speaking to him.
  • SSpvp 2 will also auto join AND leave.
  • Right after it finishes clicking it will activate auto-run and jump once.
  • You will eventually make it out of the cave this way and avoid being reported ever.

Now I'm realizing some people probably think mines the most inefficient script there is, that's why I'm posting! Can someone tell me what could be changed to either.. Make things MORE random, make LESS script, and the biggest one... Make it so I can initiate the auto run sequence ONLLLY when it detects a certain color in a certain location. (I've searched for this one but to no avail! :) )

P.s. It would be nice to make it so people DON'T have to change the cordinates to adjust to their resolution... I read something about Pixelshader or Pixelsomething ... Can someone give me a rough explanation on that?

Any advice is greatly appreciated!

Global $Paused;This defines what the function "TogglePause" is supposed to pause.
HotKeySet("{PAUSE}", "TogglePause");Pressing the "pause/break" key will pause the process.
HotKeySet("{F8}", "Terminate");Pressing the "F8" key will immediately Terminate the process.

$title = "World of Warcraft";This changes your active window to World of Wacraft.
WinActivate($title)
WinWaitActive($title)

While 1; This is the bot script right here.
MouseMove(Random(740, 810), Random(485, 525));First cordinate is your X and it goes Minimum, Maximum. 
Sleep(Random(10,100,1))
MouseClick("RIGHT")
Sleep(Random(10,100,1))
MouseMove(Random(740, 810), Random(485, 525));Second is your Y, same thing.
Sleep(Random(10,100,1))
MouseClick("RIGHT")
Sleep(Random(10,100,1))
MouseMove(Random(740, 810), Random(485, 525))
Sleep(Random(10,100,1));This is the delay between moves and clicks.
MouseClick("RIGHT")
Sleep(Random(10,100,1))
MouseMove(Random(740, 810), Random(485, 525))
Sleep(Random(10,100,1))
MouseClick("RIGHT")
Sleep(Random(10,100,1))
MouseMove(Random(740, 810), Random(485, 525))
Sleep(Random(10,100,1))
MouseClick("RIGHT")
Sleep(Random(10,100,1))
MouseMove(Random(740, 810), Random(485, 525))
Sleep(Random(10,100,1))
MouseClick("RIGHT")
Sleep(Random(10,100,1))
MouseMove(666, 666,10)
MouseClick("RIGHT")
MouseDown("RIGHT");This makes it hold the mouse down.
MouseMove(650,666)
MouseUp("RIGHT");Allowing you to turn your camera slightly to avoid cave walls.
Sleep(Random(500,1000,1))
Send("{r}");This is my auto-run keybind, change it to yours.
Send("{Space}");This is to jump over obstacles and to mix it up a bit.
Wend

Func TogglePause();This defines what "TogglePause" means for the script.
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate();This defines what "Terminate" is supposed to Terminate.
    Exit
EndFunc
Edited by Red2008
Link to comment
Share on other sites

Global $Paused;This defines what the function "TogglePause" is supposed to pause.
HotKeySet("{PAUSE}", "TogglePause");Pressing the "pause/break" key will pause the process.
HotKeySet("{F8}", "Terminate");Pressing the "F8" key will immediately Terminate the process.

$title = "World of Warcraft";This changes your active window to World of Wacraft.
WinActivate($title)
WinWaitActive($title)

While 1; This is the bot script right here.
MouseMove(Random(740, 810), Random(485, 525));First cordinate is your X and it goes Minimum, Maximum. 
Sleep(Random(10,100,1))
MouseClick("RIGHT")
Sleep(Random(10,100,1))
MouseMove(Random(740, 810), Random(485, 525));Second is your Y, same thing.
Sleep(Random(10,100,1))
MouseClick("RIGHT")
Sleep(Random(10,100,1))
MouseMove(Random(740, 810), Random(485, 525))
Sleep(Random(10,100,1));This is the delay between moves and clicks.
MouseClick("RIGHT")
Sleep(Random(10,100,1))
MouseMove(Random(740, 810), Random(485, 525))
Sleep(Random(10,100,1))
MouseClick("RIGHT")
Sleep(Random(10,100,1))
MouseMove(Random(740, 810), Random(485, 525))
Sleep(Random(10,100,1))
MouseClick("RIGHT")
Sleep(Random(10,100,1))
MouseMove(Random(740, 810), Random(485, 525))
Sleep(Random(10,100,1))
MouseClick("RIGHT")
Sleep(Random(10,100,1))
MouseMove(666, 666,10)
MouseClick("RIGHT")
MouseDown("RIGHT");This makes it hold the mouse down.
MouseMove(650,666)
MouseUp("RIGHT");Allowing you to turn your camera slightly to avoid cave walls.
Sleep(Random(500,1000,1))
Send("{r}");This is my auto-run keybind, change it to yours.
Send("{Space}");This is to jump over obstacles and to mix it up a bit.
Wend

Func TogglePause();This defines what "TogglePause" means for the script.
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate();This defines what "Terminate" is supposed to Terminate.
    Exit
EndFunc

You have repeated one section of code 6 times or so, and it would be better and easier to use a for next loop

While 1; This is the bot script right here.
    for $n = 1 to 6
        MouseMove(Random(740, 810), Random(485, 525))
        Sleep(Random(10,100,1))
        MouseClick("RIGHT")
        Sleep(Random(10,100,1))
    next


    MouseMove(666, 666,10)
    MouseClick("RIGHT")
    MouseDown("RIGHT");This makes it hold the mouse down.
    MouseMove(650,666)
    MouseUp("RIGHT");Allowing you to turn your camera slightly to avoid cave walls.
    Sleep(Random(500,1000,1))
    Send("{r}");This is my auto-run keybind, change it to yours.
    Send("{Space}");This is to jump over obstacles and to mix it up a bit.
Wend

The pixel function you were after is probably PixelCheckSum.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

You have repeated one section of code 6 times or so, and it would be better and easier to use a for next loop

While 1; This is the bot script right here.
    for $n = 1 to 6
        MouseMove(Random(740, 810), Random(485, 525))
        Sleep(Random(10,100,1))
        MouseClick("RIGHT")
        Sleep(Random(10,100,1))
    next


    MouseMove(666, 666,10)
    MouseClick("RIGHT")
    MouseDown("RIGHT");This makes it hold the mouse down.
    MouseMove(650,666)
    MouseUp("RIGHT");Allowing you to turn your camera slightly to avoid cave walls.
    Sleep(Random(500,1000,1))
    Send("{r}");This is my auto-run keybind, change it to yours.
    Send("{Space}");This is to jump over obstacles and to mix it up a bit.
Wend

The pixel function you were after is probably PixelCheckSum.

Oh ty that's a big help. I'll definitely look into that PixelChecksum.

Very interested in learning more about AutoIt. :)

Btw if I edited this around...

While 1
    For $i=Random(360, 480) to 1 Step -1
        Sleep(250)
        $bge=PixelGetColor(790, 710)
        $res=PixelGetColor(740, 240)
        $resc=PixelGetColor(820, 235)
        If Hex($bge, 6) = "690505" Then;if the battle ground has ended
            MouseClick("Left", 790, 710, 2)
            MouseMove(400, 400)
            Exit
        ElseIf Hex($res, 6) = "F1C300" Then;if chracter is dead
            MouseClick("Left", 795, 240, 2)
            MouseMove(400, 400)
        ElseIf Hex($resc, 6) = "700100" Then;cancel resurrecting
            MouseClick("Left", 795, 240, 2)
            MouseMove(400, 400)
        EndIf
    Next
    Send("{SPACE}")
WEnd

Could I what I wanted? Like if I changed it to find MY color at MY cordinate. Then putting the auto run sequence in there... Would it work? Or is there a more efficient way of doing this? (Of course more than that but just using this piece as a point of reference.)

Edited by Red2008
Link to comment
Share on other sites

can you say how your auto run thing works? from the looks of it it just runs straight how do you know its not running into a wall?

Because I watch it from the start. :)

I plan on making it more detailed if I can get this color activation going. In one of the mouse moves it actually turns the camera slightly to the left to avoid the stuff in the cave.

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