Sign in to follow this  
Followers 0
Analyze

Need help with Script

3 posts in this topic

#1 ·  Posted (edited)

Hi all i need short help with the script when i press Start Bot the bot start but when i click on pause the bot dont stop same with exit -.-.

i dont understand what i need to change -.- not a pro in autoit

i know the bot will hang in the While loop of the start Function but i dont know how to fix it.Anybody can help me out ?

#include-once
#include <GUIConstants.au3>
#include <TabConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <UpdownConstants.au3>
#include <EditConstants.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
;- Get image
Inetget("http://gamer.siammaster.com/images/dekaron-logo.gif", @TempDir & "\dekaron-logo.gif",0,0)
;- Done

    $BotGui = GUICreate("Dekaron Spambot v1", 400,400,300,250, $WS_POPUP,BitOR($WS_EX_TOPMOST,$WS_EX_TOOLWINDOW))
    WinActivate("Dekaron")
    WinWaitActive ("Dekaron")
    GUISetBkColor(0x140000)
    GUISetFont(11,400,0,"Constantia",$BotGui)
    $GUI_Pic_Map = GUICtrlCreatePic(@TempDir & "\dekaron-logo.gif", 0, 0, 400, 150,0)
    Winsettrans("dekaron Spambot v1","",180)
    GUICtrlCreateLabel("Dekaron Spam Bot v1",110,150,200,25)
    GUICtrlSetColor(-1,0xFF0000)
    GUICtrlSetFont(-1,14,500, 0,"Constantia")
    GUICtrlCreateGroup("",0,60,200,10)
    GUICtrlSetColor(-1,0xFF0000)
    GUISetState(@SW_SHOW)


$Button1 = GUICtrlCreateButton("Start Bot", 50,350,60,20)
$Button2 = GUICtrlCreateButton("Pause Bot", 120,350,60,20)
$Button3 = GUICtrlCreateButton("Exit  Bot", 220,350,60,20)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_Start()
Case $Button2
_Pause()
Case $Button3
_Ende() 
EndSwitch
WEnd

Func _Start()
While 1
ControlSend ( "Dekaron", "", "", "1")
sleep(1000)
ControlSend ( "Dekaron", "", "", "2")
sleep(1000)
ControlSend ( "Dekaron", "", "", "3")
sleep(1000)
ControlSend ( "Dekaron", "", "", "4")
sleep(1000)
ControlSend ( "Dekaron", "", "", "5")
sleep(1000)
ControlSend ( "Dekaron", "", "", "6")
sleep(1000)
WEnd
EndFunc

Func _Pause()
While 1
Sleep(3000)
WEnd
EndFunc

Func _Ende()
MsgBox(0, "© by Black", "Dekaron Spambot v1", 10000)
Exit
EndFunc
Edited by Analyze

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi all i need short help with the script when i press Start Bot the bot start but when i click on pause the bot dont stop same with exit -.-.

i dont understand what i need to change -.- not a pro in autoit

i know the bot will hang in the While loop of the start Function but i dont know how to fix it.Anybody can help me out ?

#include-once
#include <GUIConstants.au3>
#include <TabConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <UpdownConstants.au3>
#include <EditConstants.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
;- Get image
Inetget("http://gamer.siammaster.com/images/dekaron-logo.gif", @TempDir & "\dekaron-logo.gif",0,0)
;- Done

    $BotGui = GUICreate("Dekaron Spambot v1", 400,400,300,250, $WS_POPUP,BitOR($WS_EX_TOPMOST,$WS_EX_TOOLWINDOW))
    WinActivate("Dekaron")
    WinWaitActive ("Dekaron")
    GUISetBkColor(0x140000)
    GUISetFont(11,400,0,"Constantia",$BotGui)
    $GUI_Pic_Map = GUICtrlCreatePic(@TempDir & "\dekaron-logo.gif", 0, 0, 400, 150,0)
    Winsettrans("dekaron Spambot v1","",180)
    GUICtrlCreateLabel("Dekaron Spam Bot v1",110,150,200,25)
    GUICtrlSetColor(-1,0xFF0000)
    GUICtrlSetFont(-1,14,500, 0,"Constantia")
    GUICtrlCreateGroup("",0,60,200,10)
    GUICtrlSetColor(-1,0xFF0000)
    GUISetState(@SW_SHOW)


$Button1 = GUICtrlCreateButton("Start Bot", 50,350,60,20)
$Button2 = GUICtrlCreateButton("Pause Bot", 120,350,60,20)
$Button3 = GUICtrlCreateButton("Exit  Bot", 220,350,60,20)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_Start()
Case $Button2
_Pause()
Case $Button3
_Ende() 
EndSwitch
WEnd

Func _Start()
While 1
ControlSend ( "Dekaron", "", "", "1")
sleep(1000)
ControlSend ( "Dekaron", "", "", "2")
sleep(1000)
ControlSend ( "Dekaron", "", "", "3")
sleep(1000)
ControlSend ( "Dekaron", "", "", "4")
sleep(1000)
ControlSend ( "Dekaron", "", "", "5")
sleep(1000)
ControlSend ( "Dekaron", "", "", "6")
sleep(1000)
WEnd
EndFunc

Func _Pause()
While 1
Sleep(3000)
WEnd
EndFunc

Func _Ende()
MsgBox(0, "© by Black", "Dekaron Spambot v1", 10000)
Exit
EndFunc

Ok, so when you press the Start button it goes into a loop which it never exits. Meaning your bot will not respond to anything else you tell it to do, it'll just endlessly do that loop.

So instead do this

#include <GUIConstants.au3>
#include <TabConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <UpdownConstants.au3>
#include <EditConstants.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
;- Get image
Inetget("http://gamer.siammaster.com/images/dekaron-logo.gif", @TempDir & "\dekaron-logo.gif",0,0)
;- Done

    $BotGui = GUICreate("Dekaron Spambot v1", 400,400,300,250, $WS_POPUP,BitOR($WS_EX_TOPMOST,$WS_EX_TOOLWINDOW))
    WinActivate("Dekaron")
    WinWaitActive ("Dekaron")
    GUISetBkColor(0x140000)
    GUISetFont(11,400,0,"Constantia",$BotGui)
    $GUI_Pic_Map = GUICtrlCreatePic(@TempDir & "\dekaron-logo.gif", 0, 0, 400, 150,0)
    Winsettrans("dekaron Spambot v1","",180)
    GUICtrlCreateLabel("Dekaron Spam Bot v1",110,150,200,25)
    GUICtrlSetColor(-1,0xFF0000)
    GUICtrlSetFont(-1,14,500, 0,"Constantia")
    GUICtrlCreateGroup("",0,60,200,10)
    GUICtrlSetColor(-1,0xFF0000)
    GUISetState(@SW_SHOW)


$Button1 = GUICtrlCreateButton("Start Bot", 50,350,60,20)
$Button2 = GUICtrlCreateButton("Pause Bot", 120,350,60,20)
$Button3 = GUICtrlCreateButton("Exit  Bot", 220,350,60,20)

$DoStuff = False

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_Start()
Case $Button2
_Pause()
Case $Button3
_Ende() 
EndSwitch
If $DoStuff Then
ControlSend ( "Dekaron", "", "", "1")
sleep(1000)
EndIf
WEnd

Func _Start()
$DoStuff = True
EndFunc

Func _Pause()
$DoStuff = False
EndFunc

Func _Ende()
MsgBox(0, "© by Black", "Dekaron Spambot v1", 10000)
Exit
EndFunc

But this also means that the bot will take longer to respond to clicks etc. when $DoStuff is true (When the bot is on).

But at least it will respond.

Edited by BAM5

[center]JSON Encoding UDF[/center]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thx its work :) .

Edited by Analyze

Share this post


Link to post
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
Sign in to follow this  
Followers 0