flozcag

Script

8 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



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

 


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

My UDFs, Abbrevs and Snippets
If you like my post, just click the like button :) 

Share this post


Link to post
Share on other sites

What I meant is the script doesn't send the F2 function, like it's just not working or skipping it in the whole script.

Could you help me with the pause? I don't really know what you mean

Share this post


Link to post
Share on other sites

Also it's not a bot, It's supposed to be a floor clearing program for my map's on my game server.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Should I try "controlsend" instead of "send" regarding the F2 function?

Edited by flozcag

Share this post


Link to post
Share on other sites

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


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.