Jump to content

Script


flozcag
 Share

Recommended Posts

Hey, I'm trying to write a script, I just started on this forum, still learning and need help, basically everything is working but function F2 and the pause, please look in to it, also I would like to add simple copyright message, could someone help me with it?

The script doesn't read function F2, looks like its skipping it
The pause is not working, you can start it but can't pause it

 

HotKeySet("!{PAUSE}", "_Start")
HotKeySet("{ESC}", "_Exit")

;sets the hot key "alt+pause" for function _start
;sets the hot key "esc" for function _exit

Global $isPaused = True

;bool for toggle start/pause

While 1
    If $isPaused = False Then
        ;checks if bot is on/off
        ;if on then...
        ;everything in this while will be repeated until you press alt+pause again
        Send("{F1}")
        ;sends key F1
        Sleep(2000)
        ;sleeps for 2000ms = 2s
        MouseClick("Right")
        ;uses right click (mouse)

        Send("{F2}")
        Sleep(2000)
        MouseClick("Right")

        $timer = TimerInit()
        ;sets a timer
        $diff = TimerDiff($timer)
        ;reads the time difference to TimerInit()
        While $diff < 120000
            ;while the timer difference is less than 120000ms (2min).....
            $diff = TimerDiff($timer)
            ;read diff again otherwise it will always be as big as before the while
            Send("{F3}")
            Sleep(2000)
            MouseClick("Right")
        WEnd
    EndIf
    ;if off then ask again
WEnd

Func _Start()
    ;function which is called by pressing alt+pause
    If $isPaused = False Then $isPaused = True
    If $isPaused = True Then $isPaused = False
EndFunc

Func _Exit()
    Exit
EndFunc

 

Edited by flozcag
Link to comment
Share on other sites

  • Developers

Where does your script "read" f2?  .. and have a closer look at your _Start() udf, the outcome of your 2 If statements is that $ispaused is always eq False!

Also make sure you read up on our forumrules as you are mentioning the magic word "bot" in there.

Jos

 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Func _Start()
    ;function which is called by pressing alt+pause
    ;If $isPaused = False Then $isPaused = True
    ;If $isPaused = True Then $isPaused = False
    $isPaused = NOT $isPaused
EndFunc


 

Edited by Exit

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

  • Developers

The second question is just answered by somebody without giving you the chance to think about it first. :)

The F2 is send,  but the questions probably is which application received it.

Jos

 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Moderators

flozcag,

It's supposed to be a [...] program for [...] my game server

 I have pointed you at the rules already - so which bit of:

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

[...]
Launching, automation or script interaction with games or game servers, regardless of the game.

was unclear? 

You have used up al flex we are prepared to give you - best you stick within those rules from now on. Thread locked.

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