Jump to content

help with my script


Jer-
 Share

Recommended Posts

what it does is holds shift and holds my left mouse button for spamming hammer purposes on my game (diablo 2)

the problem is when i try putting a pause in it..it says error

can someone tell me how to fix or fix it for me? heres what i have and it works but doesnt have pause option atm:

Global $Paused

HotKeySet("{INSERT}", "Attack")

While 1

Sleep (100)

WEnd

Func Attack()

$Paused = NOT $Paused

While $Paused

sleep(100)

Send("{SHIFTDOWN}")

Mousedown("left")

WEnd

Send("{SHIFTUP}")

Mouseup("left")

EndFunc

Link to comment
Share on other sites

Try putting the main part of your script in your keep alive loop, and only have the $Paused = NOT $Paused part in the function.

edit - maybe something along the lines of this (you don't say what the error is, but this should work):

Global $Paused
HotKeySet("{INSERT}", "Attack")


While 1
    Sleep(100)
    If $Paused Then
        While $Paused
            Sleep(100)
            Send("{SHIFTDOWN}")
            MouseDown("left")
        WEnd
        Send("{SHIFTUP}")
        MouseUp("left")
    EndIf
WEnd

Func Attack()
    $Paused = Not $Paused
EndFunc
Edited by xcal
Link to comment
Share on other sites

Oh. In that case, try this:

Global $Paused
HotKeySet("{INSERT}", "Attack")


While 1
    Sleep(100)
    If $Paused Then
        While $Paused
            ToolTip('inside the if/endif while loop.')
            Sleep(100)
        WEnd
        ToolTip('while loop exited.  exiting if/endif next')
        Sleep(2000)
    EndIf
    ToolTip('the script is paused and I really should try stuff someone suggests before posting again')
WEnd

Func Attack()
    $Paused = Not $Paused
EndFunc
Link to comment
Share on other sites

so do you want to pretty much you want 2 hotkeys one for shift one for left click

when you press both of the hot keys it will do shift left click shift left click shift left click shift left click...so on so on untill you press both hot keys again?

Well if it is here is the script for that:

Global $F5OnOff
Global $F6OnOff

HotKeySet("{F5}", '_SendShift')
HotKeySet('{F6}', '_SendLeftClick')

GUICreate("Diablo 2 Bot", 300, 300)
$dummy = GUICtrlCreateDummy()
GUICtrlSetOnEvent($GUI_EVENT_CLOSE, 'Show')
GUISetBkColor(0x000000)
$lable = GUICtrlCreateLabel("F5 turns on/off shift presser" & @CRLF & "F6 turns on/off leftmouse clicker", 80, 70)
$info_button = GUICtrlCreateButton ("About", 125, 150, 70, 20)
GUICtrlSetBkColor($lable, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor($lable, 0xFFFFFF)
GUICtrlSetCursor(-1, 3)
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    DoDefaultTasks()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Onexit()
        Case $msg = $info_button
            About()
    EndSelect
WEnd

Func Show()
    GUICtrlSendToDummy($dummy)
EndFunc

Func DoDefaultTasks()
    If $F5OnOff Then Send('{LSHIFT}')
    If $F6OnOff Then MouseClick('left')
EndFunc 
    
Func Onexit()
    Exit
EndFunc

Func _SendShift()
    $F5OnOff = Not $F5OnOff
EndFunc

Func _SendLeftClick()
    $F6OnOff = Not $F6OnOff
EndFunc

Func About()
    MsgBox(48, "Diablo 2 Bot About", "This was made by ToothyXdip")
EndFunc
Edited by toothyXdip
---╔╦═╗╔╗'''╔╗╔═╦═╗╔╦═╗---╝╠═╣╝║'''║╝╝''''''╝╝║'''......''''''''''''''''''''''''''''''---╔╩═╩═╩═╩═══╩═╦═╩═╩══╦══════╗''''╔╩════════════╩══╗╔══╩══╗╔══╝ ''''''''''''''''''''''''''''''''''''''''''''''''''''║║'''''''''''''''║║ ''''''''''''''''''''''''''''''''''''''''''''''╔══╝╚══╗''''''║║''''''''''''''''''''''''''''''''''''''''''''''╚══════╝''''''╚╝
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...