Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Release (2021-08-11)
- AppVer := "RaidClicker v1.2.0"
- ;Made by JimmyFLASH
- ;jimmyflash(at)seznam.cz
- ;Pastebin: https://pastebin.com/7vUps4YP
- ;AutoHotkey: https://www.autohotkey.com/
- ;
- ;This script to be used with AutoHotkey software. Save the script as a "WhatEverName.ahk" file.
- ;This script helps in the Raid Shadow Legends game to automatically Replay Battle or Play Next Level Battle.
- ;Is possible to set clicking interval, count or duration.
- #MaxThreadsPerHotkey 2
- #SingleInstance Off ;[ForceIgnorePromptOff]
- SetTitleMatchMode, 2
- ; Initial Variables
- Counter := 0
- Duration := 0
- Stopwatch := new SecondCounter
- txtStatus := "Disabled"
- ; Create GUI
- ; Controlls
- Gui, Add, Text, x35, F3: Enable/Disable F8: Exit
- ; Groups
- Gui, Add, GroupBox, x10 w215 h70, Interval
- Gui, Add, GroupBox, x10 w215 h115, Duration
- Gui, Add, GroupBox, x10 w215 h40, Command
- ; Interval
- Gui, Add, Text, x23 y45, Hour
- Gui, Add, Text, xp+50, Min
- Gui, Add, Text, xp+50, Sec
- Gui, Add, Text, xp+50, mSec
- Gui, Add, Edit, x20 yp+16 w45
- Gui, Add, UpDown, vCtrl_Int_H 0x80 Range0-999, 0 ;set initial Interval (Hour)
- Gui, Add, Edit, x+5 w45
- Gui, Add, UpDown, vCtrl_Int_M 0x80 Range0-999, 0 ;set initial Interval (Min)
- Gui, Add, Edit, x+5 w45
- Gui, Add, UpDown, vCtrl_Int_S 0x80 Range0-999, 5 ;set initial Interval (Sec)
- Gui, Add, Edit, x+5 w45
- Gui, Add, UpDown, vCtrl_Int_mS 0x80 Range0-999, 0 ;set initial Interval (mSec)
- ; Duration
- ; Duration Radio Buttons (move "Checked" for change initial value)
- Gui, Add, Radio, Checked x20 y125 vCtrl_Radio1 RadioGroupDuration, Infinite ;Infinite
- Gui, Add, Radio, x+10 vCtrl_Radio2, Counter ;Counter
- Gui, Add, Radio, x20 yp25 vCtrl_Radio3 , Timer ;Timer
- ; Counter
- Gui, Add, Edit, x140 y122 w75
- Gui, Add, UpDown, vCtrl_MaxCount 0x80 Range1-1000000, 100 ;set initial Counter
- ; Timer
- Gui, Add, Text, x23 y170, Hour
- Gui, Add, Text, xp+50, Min
- Gui, Add, Text, xp+50, Sec
- Gui, Add, Text, xp+50, mSec
- Gui, Add, Edit, x20 yp+16 w45
- Gui, Add, UpDown, vCtrl_Dur_H 0x80 Range0-999, 0 ;set initial Duration (Hour)
- Gui, Add, Edit, x+5 w45
- Gui, Add, UpDown, vCtrl_Dur_M 0x80 Range0-999, 3 ;set initial Duration (Min)
- Gui, Add, Edit, x+5 w45
- Gui, Add, UpDown, vCtrl_Dur_S 0x80 Range0-999, 30 ;set initial Duration (Sec)
- Gui, Add, Edit, x+5 w45
- Gui, Add, UpDown, vCtrl_Dur_mS 0x80 Range0-999, 0 ;set initial Duration (mSec)
- ; Command
- ; Command Radio Buttons (move "Checked" for change initial value)
- Gui, Add, Radio, Checked x20 y240 vCtrl_Radio_Replay RadioGroupCommand, Replay ;Replay
- Gui, Add, Radio, x+10 vCtrl_Radio_Next, Next ;Next
- Gui, Add, Radio, x+10 vCtrl_Radio_Custom, Next/Replay ;Custom
- ; Status Text + Counter
- Gui, Add, Text, x15 y+20, RaidClicker status:
- Gui, Font, s12 bold,
- Gui, Add, Text, cRed x+5 yp-5 w110 vCtrl_Status, %txtStatus%
- Gui, Font, s8 norm,
- Gui, Add, Text, x15, Counter:
- Gui, Add, Text, cRed x+5 w150 vCtrl_Counter, %Counter%
- ; Progress Bars
- Gui, Add, Progress, x10 w215 h5 cBlue vCtrl_ProgressBarInt, 100
- Gui, Add, Progress, x10 yp+4 w215 h5 cRed vCtrl_ProgressBarDur, 100
- ; Status Bar
- Gui, Add, StatusBar,, Bar's starting text (omit to start off empty).
- SB_SetText(" Made by JimmyFLASH")
- ; Show GUI
- Gui, Show, NoActivate, %AppVer%
- return
- Update: ; Update GUI values
- ElapsedTimeInt := A_TickCount - StartTimeInt
- ElapsedTimeDur := A_TickCount - StartTimeDur
- ElapsedTimeDurSec := ElapsedTimeDur // 1000
- ; check if the time is up
- GuiControlGet, Ctrl_Dur_H
- GuiControlGet, Ctrl_Dur_M
- GuiControlGet, Ctrl_Dur_S
- GuiControlGet, Ctrl_Dur_mS
- GuiControlGet, Ctrl_Radio3
- DurMax := Ctrl_Dur_mS + Ctrl_Dur_S*1000 + Ctrl_Dur_M*1000*60 + Ctrl_Dur_H*1000*60*60
- If Ctrl_Radio3 AND (ElapsedTimeDur >= DurMax)
- {
- gosub StopTimer
- }
- GuiControl, Text, Ctrl_Status, %txtStatus%
- GuiControl, Text, Ctrl_Counter, %Counter% ( %ElapsedTimeDurSec% s)
- ValueInt := 100 - (ElapsedTimeInt * 100 / Interval)
- ValueDur := 100
- If Ctrl_Radio2
- {
- ValueDur := 100 - (Counter * 100 / Ctrl_MaxCount)
- }
- If Ctrl_Radio3
- {
- ValueDur := 100 - (ElapsedTimeDur * 100 / DurMax)
- }
- GuiControl,, Ctrl_ProgressBarInt, %ValueInt%
- GuiControl,, Ctrl_ProgressBarDur, %ValueDur%
- ;MouseGetPos , OutputVarX, OutputVarY, , ,
- ;SB_SetText(OutputVarX . " " . OutputVarY)
- ;SB_SetText(Interval . " " . Counter . " " . Ctrl_MaxCount . " " . Toggle)
- ;SB_SetText(Toggle)
- return
- SendKey:
- StartTimeInt := A_TickCount
- Counter++
- gosub Update
- GuiControlGet, Ctrl_Radio_Replay
- GuiControlGet, Ctrl_Radio_Next
- GuiControlGet, Ctrl_Radio_Custom
- ; Trigger the click
- WinGetActiveTitle, Title
- WinActivate, ahk_exe Raid.exe
- If Ctrl_Radio_Replay
- {
- ControlSend, , r, ahk_exe Raid.exe ; send "R" key to Raid Window
- }
- If Ctrl_Radio_Next
- {
- ControlSend, , {Space}, ahk_exe Raid.exe ; send "SPACE" key to Raid Window
- Sleep 25
- ControlSend, , {Enter}, ahk_exe Raid.exe ; send "ENTER" key to Raid Window
- }
- If Ctrl_Radio_Custom ; Set custom commands for send to Raid Window
- {
- ControlSend, , {Space}, ahk_exe Raid.exe ; send "SPACE" key to Raid Window
- Sleep 25
- ControlSend, , {Enter}, ahk_exe Raid.exe ; send "ENTER" key to Raid Window
- Sleep 1000
- ControlSend, , r, ahk_exe Raid.exe ; send "ENTER" key to Raid Window
- }
- Sleep 25
- WinActivate, %Title%
- ; check if the counter is up
- GuiControlGet, Ctrl_MaxCount
- GuiControlGet, Ctrl_Radio2
- If Ctrl_Radio2 AND (Counter >= Ctrl_MaxCount)
- {
- gosub StopTimer
- return
- }
- return
- RunTimer:
- Toggle := !Toggle
- txtStatus := "Enabled"
- Counter := 0
- Duration := 0
- StartTimeInt := A_TickCount
- StartTimeDur := A_TickCount
- GuiControlGet, Ctrl_Int_H
- GuiControlGet, Ctrl_Int_M
- GuiControlGet, Ctrl_Int_S
- GuiControlGet, Ctrl_Int_mS
- Interval := Ctrl_Int_mS + Ctrl_Int_S*1000 + Ctrl_Int_M*1000*60 + Ctrl_Int_H*1000*60*60
- SetTimer, SendKey, %Interval%
- SetTimer, Update, 251
- gosub Update
- gosub SendKey
- ; check if the counter is up
- GuiControlGet, Ctrl_MaxCount
- GuiControlGet, Ctrl_Radio2
- If Ctrl_Radio2 AND (Counter >= Ctrl_MaxCount)
- {
- gosub StopTimer
- return
- }
- return
- StopTimer:
- Toggle := !Toggle
- txtStatus := "Disabled"
- Counter := 0
- Duration := 0
- StartTimeInt := A_TickCount
- StartTimeDur := A_TickCount
- SetTimer, SendKey, Off
- SetTimer, Update, Off
- gosub Update
- return
- F3::
- If Toggle
- {
- gosub StopTimer
- return
- }
- gosub RunTimer
- return
- F8::
- GuiClose:
- ExitApp
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement