Sign in to follow this  
Followers 0
BryanMc

[Help] Resetting While function and starting over?

4 posts in this topic

well i have a script that i am using for a elevation mini game that i am making but the script works perfect but i want a func in it but cant seem to figure it out... i tryed searching on the web and forum site but with no help

here is the script and what i am trying to do is when the character dies in func "CheckDead()" will end the while loop and start the while loop from the top again without the pause

Global $Paused
HotKeySet("=","TogglePause")  ;script can be START and PAUSE by pressing = Also Show some statistics
HotKeySet("x", "Stop")
$Run = False
While True
   if($Run) Then
          Sleep(3000)
   Sleep(500)
   MouseMove(Round(587 * $x_ratio),Round(333 * $y_ratio),1) ;starts the main run
   Sleep(100)
   keydn("w")
   Sleep(30000)
   keyup("w")
   [color=#ff0000]CheckDead() ;Checks dead on spawn[/color]
   Sleep(1800)
   MouseMove(Round(96 * $x_ratio),Round(383 * $y_ratio),1)
   Sleep(500)
   MouseMove(Round(587 * $x_ratio),Round(333 * $y_ratio),1) ;starts the main run
   Sleep(100)
   keydn("w")
   Sleep(30000)
   keyup("w")
    EndIf
Wend
Func CheckDead() ; exit game then restarts
   $Pixeltest = PixelGetColor(Round(740*$x_ratio), Round(850*$y_ratio))
   If Hex($Pixeltest, 6) == "0C0404" OR Hex($Pixeltest, 6) == "310000" Then
   Sleep(100)
   Send("{Escape}")
   Sleep(10)
   MouseClick("left", Round(956*$x_ratio),Round(579*$y_ratio))
   Sleep(14000)
   Send(".")
   Sleep(50)
   MouseClick("left",Round(1082 *$x_ratio),Round(635 * $y_ratio))
   Sleep(50)
   MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio))
   Sleep(8000)
   Sleep(3000)
   $Flag = True
   Else
   $Flag = False 
   Sleep(500)
   EndIf
   Return $Flag
EndFunc

Func TogglePause()
        $Run = Not $Run
        While Not $Run
            Sleep(100)
            ToolTip("Bot Paused",887, 60)
        WEnd
   UpdateLootStatus()
EndFunc   ;==>TogglePause
Func Stop() ;to allow the script to stop
    Exit 0
EndFunc

if anyone can help me with the func for the reset loop if Checkdead() is activated... that would be great thanks.... this is for a game that i am creating my self not a boot leg game... fyi

Share this post


Link to post
Share on other sites



BryanMc,

As your (first and) last thread was locked because you asked for help with a game bot you have no credibility here, so merely stating the code is for a game you have created yourself is not enough. ;)

Show the code you have written so far for this game or I will assume that it is a third-party app with the inevitable consequences. By all means send it to me in PM if you do want to expose it in open forum. :)

Until then - I would be grateful if no-one else posts in this thread. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

what i have posted is what i have made so far for the script is to move the mouse to a location then hold down the "w" key to move forward, then at the end of the run to check if it has been killed by any monster's if not then it will start moving again to a safe location, If it dies within the run... thats where the func check dead comes in to play and it will log out then relog in and repeat

it is a elevation game that i am trying to make my self as there is no login name or password needed to run because it is client side right now... and not open to the public... thats why the Check dead only exits the window then reopens it...

my other post was making a word find... this has nothing to do with word finding what so ever... sorry i really dont know what else to say to get some help... this is not for any third party apps

P.S.

what i am trying to get it to do is ....

if checkdead is positive then it will still do the marked red...then...(read blue in code)

Func CheckDead() ; exit game then restarts

$Pixeltest = PixelGetColor(Round(740*$x_ratio), Round(850*$y_ratio))

If Hex($Pixeltest, 6) == "0C0404" OR Hex($Pixeltest, 6) == "310000" Then

Sleep(100)

Send("{Escape}")

Sleep(10)

MouseClick("left", Round(956*$x_ratio),Round(579*$y_ratio))

Sleep(14000)

Send(".")

Sleep(50)

MouseClick("left",Round(1082 *$x_ratio),Round(635 * $y_ratio))

Sleep(50)

MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio))

Sleep(8000)

Sleep(3000)

$Flag = True

("Then it will end the while loop and starts the while loop again from the top of the while loop")

Else

$Flag = False

Sleep(500)

EndIf

Return $Flag

EndFunc

Edited by BryanMc

Share this post


Link to post
Share on other sites

BryanMc,

Your last thread was locked because you admitted you were trying to bot Diablo 3 - claiming that "my other post was making a word find" is ingenuous at best - and does not make me any more likely to believe you this time. :)

From what you have now told me I understand that you are once again botting a game - the fact that it is only for your personal use is immaterial. The Forum Rules are quite clear on this - the discussion and posting of any code that interacts with any game or game server is prohibited here. ;)

This thread is now closed - do NOT open another thread on game bots or sanctions will follow. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


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