Help with compiling scripts into one? (and some other questions

Ask gaming related questions (AHK v1.1 and older)
wasd9555
Posts: 3
Joined: 19 Jul 2021, 12:03

Help with compiling scripts into one? (and some other questions

Post by wasd9555 » 19 Jul 2021, 12:16

So I making an AFK farm for Rainbow Six Siege and I have my mouse clicks and positions and everything and Timer, Controls and everything but I worked on it separately so it's not really compiling as well as I thought I also have some other questions
Timer Script:

Code: Select all

#NoEnv
#singleinstance force


timerm := "00"
timers := "00"
stopped := "0"

Gui, Font, s15 cWhite
Gui, Add, Text,x60 y20 w60 h20 vTText, %timerm%:%timers%
Gui, Add, Button,x4 y42 w80 h20 vPause, Pause
Gui, Color, White
Gui, Add, Button,x85 y42 w80 h20 vReset, Reset
Gui, Show,x0 y0 h60 w165, Stopwatch
Gui, Color, Black
Settimer, Stopwatch, 1000


Return

Stopwatch:
timers += 1
if(timers > 59)
{
timerm += 1
timers := "0"
GuiControl, , TText , %timerm%:%timers%
}
if(timers < 10)
{
GuiControl, , TText , %timerm%:0%timers%
}
else
{
GuiControl, , TText , %timerm%:%timers%
}
return

ButtonPause:
if(stopped = 0)
{
Settimer, Stopwatch, off
stopped = 1
}
else
{
Settimer, Stopwatch, 999
stopped = 0
}
return

ButtonReset:
timerm := "00"
timers := "00"
GuiControl, , TText , %timerm%:%timers%
return


GuiClose:
GuiEscape:
ExitApp
return

Code: Select all

Controls Script:
F3::
Msgbox, Start/Stop script - F1/F2, Show Controls - F3, Timer - F4

Actual Script with mouse move:
F1::
Loop,
{
MouseClick, left, 242, 607
Sleep 500
MouseClick, left, 612, 452
Sleep 500
MouseClick, left, 362, 353
Sleep 500
MouseClick, left, 1251, 954
}

F2::
pause
return
`::
exitapp
This is the one I tried to pile all the scripts in:

Code: Select all

pause toggle
#NoEnv
#singleinstance force




;TIMER
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;
F4:
timerm := "00"
timers := "00"
stopped := "0"

Gui,Font, s15 cWhite
Gui,Add, Text,x60 y20 w60 h20 vTText, %timerm%:%timers%
Gui,Add, Button,x4 y42 w80 h20 vPause, Pause
Gui,Color, White
Gui,Add, Button,x85 y42 w80 h20 vReset, Reset
Gui,Show,x0 y0 h60 w165, Stopwatch
Gui,Color, Black
Settimer, Stopwatch, 1000


Return

Stopwatch:
timers += 1
if(timers > 59)
{
timerm += 1
timers := "0"
GuiControl, , TText , %timerm%:%timers%
}
if(timers < 10)
{
GuiControl, , TText , %timerm%:0%timers%
}
else
{
GuiControl, , TText , %timerm%:%timers%
}
return

ButtonPause:
if(stopped = 0)
{
Settimer, Stopwatch, off
stopped = 1
}
else
{
Settimer, Stopwatch, 999
stopped = 0
}
return

ButtonReset:
timerm := "00"
timers := "00"
GuiControl, , TText , %timerm%:%timers%
return






;CONTROL MSGBOX
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;
F3::
Msgbox, Start/Stop script - F1/F2, Show Controls - F3, Timer - F4

return





Code: Select all

;MOUSE CLICKER SCRIPT
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
F1::
Loop,
{
MouseClick, left, 242, 607
Sleep 500
MouseClick, left, 612, 452
Sleep 500
MouseClick, left, 362, 353
Sleep 500
MouseClick, left, 1251, 954
}

F2::
pause
return
`::
exitapp
[Mod edit: [code][/code] tags added.]

But they work on their own but not together also I'm having trouble finding ways to show the timer on command like I press F4 and it shows the timer and I press it again and it hides it, Another question I want to have a renown (In game currency) counter like at the end of every terrorist hunt when it shows how much renown you earned is there away to like make ahk read that little box and send how many I earned to a gui countrer that updates or a MsgBox
Last edited by gregster on 19 Jul 2021, 12:31, edited 2 times in total.
Reason: Please use [code] tags. I could only guess where the different scripts started. Thank you!

User avatar
mikeyww
Posts: 26437
Joined: 09 Sep 2014, 18:38

Re: Help with compiling scripts into one? (and some other questions

Post by mikeyww » 20 Jul 2021, 08:37

Here is an example of how to show a GUI.

Code: Select all

Gui, Font, s10
Gui, Add, Text,, Text
F3::
If on := !on
     Gui, Show, w220, Test
Else Gui, Hide
Return
Or:

Code: Select all

Gui, New, +Hwnduid, Test
Gui, Font, s10
Gui, Add, Text, w220, Text
F3::Gui, % uid ":" (WinExist("ahk_id " uid) ? "Hide" : "Show")

Post Reply

Return to “Gaming Help (v1)”