Jump to content

First section of a script looping strangely


Guest agentyak
 Share

Recommended Posts

Guest agentyak

Hello all, I need some help with a script I'm writing. I want to preface this by saying that I know my script is not as condensed as it could be, I pulled it all out for troubleshooting's sake. When I run the following script, then hit the button to run button1(), it clicks then types the username that I have in there, then clicks and types it again. After a bunch of loops of this (maybe 15-20?) it goes on to type the password, then goes back to looping the click and type username. I can't figure out why this script is doing this. Help?

Thanks in advance!

#include 
#include 
#include 
#include 


$Form1 = GUICreate( "AutoClicker" , 1000 , 100 , 192 , 124 )
$Button1 = GUICtrlCreateButton( " Start Repeating! " , 600 , 24 , 97 , 33 )
$Exit = GUICtrlCreateButton( " Exit ",700,24,97,33)
$var1 = 2
HotKeySet("{ESC}","Pause")
HotKeySet("{Enter}", "button1")
GUISetState(@SW_SHOW)


While 1
$msg = GUIGetMsg()
If $msg = -3 Then Exit
If $msg = $Exit Then
Pause()
Exit
EndIf
If $msg = $Button1 Then button1()
WEnd

func button1()
MouseClick("left",879, 444,1,0)
Send("username",1)
Sleep(750)
Send("{ENTER}")
Sleep(750)
Send("password",1)
Sleep(750)
Send("{ENTER}")
Sleep(15000)
MouseClick("left",957, 755,1,0)
Sleep(5000)
Send("{F9}")
Sleep(10000)
MouseClick("left",1258, 480,1,0)
Sleep(3500)
MouseClick("left",200, 173,1,0)
Sleep(1000)
MouseClick("left",186, 255,1,0)
Sleep(1000)
MouseClick("left",275, 407,1,0)
Sleep(21600000)
Mouseclick("left",1331, 314,1,0)
Sleep(500)
Send("{F1}")
MouseClick("left",1362,346,1,0)
Sleep(2500)
Send("{F1}")
MouseClick("left",1367, 333,1,0)
button1()
EndFunc
Link to comment
Share on other sites

If you look at the bottom of your function - you will see you call your function again - try and remove that line and see if it clears your issue.

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Link to comment
Share on other sites

Guest agentyak

If you look at the bottom of your function - you will see you call your function again - try and remove that line and see if it clears your issue.

Hmm, with and without doing that it's now crashing returning "Exit code: -1073741819" when I try and run it. I don't see how that would fix it though, it's not getting to the end of the function.

EDIT: I fixed that error, and did what you suggested with no luck :(

Edited by agentyak
Link to comment
Share on other sites

  • Moderators

agentyak,

What exactly are you trying to do here? Labels like "AutoClicker" and "Start Repeating" do not give me a nice warm feeling. :huh:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

Guest agentyak

agentyak,

What exactly are you trying to do here? Labels like "AutoClicker" and "Start Repeating" do not give me a nice warm feeling. :huh:

M23

I'm trying to log into a program, then get it set up to play then relog in 6 hours. It's not an actual autoclicker :P

I did however use a slightly modified block of code similar to that when I was writing an autoclicker as a practice. I tend to just copy & paste that whenever I start a new script, because it's generally a similar gui setup that I need.

Edited by agentyak
Link to comment
Share on other sites

edit - removed, as mod is going to close

Edited by nitekram

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Link to comment
Share on other sites

Yes, the fact that you are trying to automate a game...RULES LINK

Do not ask for help with AutoIt scripts, post links to, or start discussion topics on the following subjects:

  • Malware of any form - trojan, virus, keylogger, spam tool, "joke/spoof" script, etc.
  • Bypassing of security measures - log-in and security dialogs, CAPTCHAs, anti-bot agents, software activation, etc.
  • Automation of software/sites contrary to their EULA (see Reporting bullet below).
  • Launching, automation or script interaction with games or game servers, regardless of the game.
  • Running or injecting any code (in any form) intended to alter the original functionality of another process.
  • Decompilation of AutoIt scripts or details of decompiler software.
This list is non-exhaustive - the Moderating team reserve the right to close any thread that they feel is contrary to the ethos of the forum Edited by nitekram

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Link to comment
Share on other sites

Guest agentyak

It didn't seem very harmful to create a program to automate relogging after you play for 6 hours. I didn't think it was automatic as they referred to it, since it's not a bot to play the game for me.

I'm sorry I bothered you guys, I'll go elsewhere.

Link to comment
Share on other sites

  • Moderators

agentyak,

I'll go elsewhere

A good idea as you will get no help here for that script - which part of "script interaction with games" do you feel it does not infringe? The Forum rules (there is also a link at bottom right of each page) are not just there for decoration - we do enforce them. Thread locked. :naughty:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...