Script Writing Help Topic is solved

Ask gaming related questions (AHK v1.1 and older)
ThatGuy

Script Writing Help

16 Jan 2018, 13:17

Good Morning Ladies and Gentlemen.

Please excuse my ignorance, I am completely new to writing a script. I have read the entire tutorial and also index of AutoHotKey. I am currently trying to write a script where it uses my FKeys to spell my character up, after the initial spell-up, it holds down the F7 key to kill mobs. I am trying to put the F7 key to hold itself down for 10min, then after that it loops to the first line all over again continuously running. There are some spells that do not auto cast on the character, so I would have to hit a F key, then click my character for it to cast directly on myself. The game is in a windowed mode. Here is what I have going below already. Please, any positive suggestions welcome.

#If WinActive("")
^q::
Loop {
SendPlay F5
SetKeyDelay, 0
SendPlay F6
SetKeyDelay, 0
SendPlay F8
SetKeyDelay, 0
SendPlay F9
SetKeyDelay, 0
SendPlay F10
SetKeyDelay, 0
SendPlay F11
SetKeyDelay, 0
SendPlay F12
SetKeyDelay, 0
SendPlay F3
SetKeyDelay, 0
SendPlay F7
SetKeyDuration, 600000 ;Not sure if this is 10min, assuming they are calculated in milliseconds

Return
}
JustARegularGuy
Posts: 6
Joined: 16 Jan 2018, 12:26

Re: Script Writing Help

16 Jan 2018, 16:51

@Exaskryz any ideas?
User avatar
derz00
Posts: 497
Joined: 02 Feb 2016, 17:54
Location: Middle of the round cube
Contact:

Re: Script Writing Help

16 Jan 2018, 17:15

Please use code tags https://autohotkey.com/boards/faq.php?mode=bbcode#f2r1

SetKeyDelay does not get reset with every Send. And SendPlay does not use the SetKeyDelay settings. Do you want the F7 key to be in the down state for 10 seconds? I guess I wouldn't know how to do that, or how to get it to work with a game.
try it and see
...
JustARegularGuy
Posts: 6
Joined: 16 Jan 2018, 12:26

Re: Script Writing Help

16 Jan 2018, 17:21

derz00 wrote:Please use code tags https://autohotkey.com/boards/faq.php?mode=bbcode#f2r1

SetKeyDelay does not get reset with every Send. And SendPlay does not use the SetKeyDelay settings. Do you want the F7 key to be in the down state for 10 seconds? I guess I wouldn't know how to do that, or how to get it to work with a game.
Yes, I need F7 to be held down, because the spell auto casts a AOE while holding down the button. I appreciate you responding with a positive post due to my ignorance.
Osprey
Posts: 453
Joined: 18 Nov 2017, 05:50

Re: Script Writing Help

16 Jan 2018, 17:25

You should probably clarify your purpose for this script. If it's to cheat (possibly level up while you're away from the computer?) in an MMO, people should know that before they help you.
JustARegularGuy
Posts: 6
Joined: 16 Jan 2018, 12:26

Re: Script Writing Help

16 Jan 2018, 17:29

Osprey wrote:You should probably clarify your purpose for this script. If it's to cheat (possibly level up while you're away from the computer?) in an MMO, people should know that before they help you.
I agree 100% with you. No, it is to help me with my arthritis. I have trouble clicking all the F keys simotaneously. If I can get something to help me, I would be very happy. I am not looking for something to do it while I away from the computer, just something to ease the pain so that I can enjoy to play.
Osprey
Posts: 453
Joined: 18 Nov 2017, 05:50

Re: Script Writing Help

16 Jan 2018, 17:53

I'm glad to hear it (not that you're in pain, of course). Sorry if I sounded accusatory. This forum gets a lot of requests from people who are trying to cheat at online games.

To hold F7 down for 10 minutes, try:

Code: Select all

F7::
  Send, {F7 down}
  Sleep, 10000
  Send, {F7 up}
Return
You can try SendPlay, but I've never found a use for it. Plain Send (which defaults to SendEvent) has been more reliable in more games for me, personally.
GreatGazoo
Posts: 69
Joined: 28 Dec 2017, 02:53

Re: Script Writing Help  Topic is solved

16 Jan 2018, 20:30

yeah i need aim bot because my arthritis, help me Kappa

lol

imo i think you should be using "sleep" instead of keydelay, i never seen anyone use keydelay after the first time,

maybe sleep 100 to give you 1/10 of a second to click your character and cast on yourself or remove the ";" on the spells that cast on yourself

Code: Select all

 
#SingleInstance, force
#If WinActive("")
setKeyDelay, 10, 10
setMouseDelay, 10

^q::
Loop {
Send, F5
;Sleep, 100 ; ------------------- optional extra sleep timer
;Click  ;--------------------------  will click wherever your mouse is
Sleep, 100
Send, F6
;Sleep, 100
;Click
Sleep, 100
Send, F8
;Sleep, 100
;Click
Sleep, 100
Send, F9
;Sleep, 100
;Click
Sleep, 100
Send, F10
;Sleep, 100
;Click
Sleep, 100
Send, F11
;Sleep, 100
;Click
Sleep, 100
Send, F12
;Sleep, 100
;Click
Sleep, 100
Send, F3
;Sleep, 100
;Click
Sleep, 100
Send, {F7 down}
  Sleep, 10000 ;ten minutes
  Send, {F7 up}
}
Return
; all loops should have some emergency pause, suspend or exit key 
Esc::
Pause
	
mast4rwang
Posts: 141
Joined: 19 Jul 2017, 09:59

Re: Script Writing Help

17 Jan 2018, 06:36

Man these answers... They probably read as much ahk as you, guy. And that "10 minute" sleep killed me... xD This is how you do it:

Code: Select all

*Q::
breaktheCHEATERloop=0
Loop,
{
if breaktheCHEATERloop=cheaterdetected!!
break

Send, {F1 Down}
Sleep,100
Send, {F1 Up}
Sleep,1000

Send, {F2 Down}
Sleep,100
Send, {F2 Up}
Sleep,1000

; continue copy pasta the buttons as many as you like until you come t that last one

Send, {F7 Down}
Sleep,600000
Send, {F7 Up}
Sleep,1000
}
Keywait,Q
return

; now we make a button to break loop

*TAB::
breaktheCHEATERloop=cheaterdetected!!
Loop,10000
soundbeep,400,200,wait
keywait,TAB
return
Happy grinding nub :HeHe: :trollface:
JustARegularGuy
Posts: 6
Joined: 16 Jan 2018, 12:26

Re: Script Writing Help

17 Jan 2018, 09:19

mast4rwang wrote:Man these answers... They probably read as much ahk as you, guy. And that "10 minute" sleep killed me... xD This is how you do it:

Code: Select all

*Q::
breaktheCHEATERloop=0
Loop,
{
if breaktheCHEATERloop=cheaterdetected!!
break

Send, {F1 Down}
Sleep,100
Send, {F1 Up}
Sleep,1000

Send, {F2 Down}
Sleep,100
Send, {F2 Up}
Sleep,1000

; continue copy pasta the buttons as many as you like until you come t that last one

Send, {F7 Down}
Sleep,600000
Send, {F7 Up}
Sleep,1000
}
Keywait,Q
return

; now we make a button to break loop

*TAB::
breaktheCHEATERloop=cheaterdetected!!
Loop,10000
soundbeep,400,200,wait
keywait,TAB
return
Happy grinding nub :HeHe: :trollface:
Listen,

I understand you are trying to troll me, by no means you are welcome to do so. What I do not understand is, why are you so disrespectful? I am here asking a simple question to ease my pain of doing the thing I love the most, and you are trying to set me up for failure. I am a 65 year old man, not very tech savvy, and was told about this program by a co-worker, that told me that it might help my situation with the cramping of my hands and grinding of bones. In the future, please try to figure out the whole situation before you start pointing a finger. I forgive you, as I do everyone. Just here trying to get help.

Thank you all for your understanding,

ThatOldGuy
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Script Writing Help

17 Jan 2018, 09:34

@ ThatOldGuy
help yourself and start playing guitar (not kidding!) or, for a start, use something like this: [commercial break] https://www.thomann.de/de/gripmaster_gm ... l_130629_1 [/commercial break].
"Regular training with the Gripmaster significantly improves the coordination, strength and flexibility of the fingers." (Google translated)
That's a bunch better for your hands as to add to your arthritis a tendonitis. Good luck :)
mast4rwang
Posts: 141
Joined: 19 Jul 2017, 09:59

Re: Script Writing Help

17 Jan 2018, 12:19

My trolling was successful on so many levels hahaha.
mast4rwang
Posts: 141
Joined: 19 Jul 2017, 09:59

Re: Script Writing Help

20 Jan 2018, 04:09

By the way, why it was successful:
I actually provided a fully functional script but with funny variable names.
JustARegularGuy
Posts: 6
Joined: 16 Jan 2018, 12:26

Re: Script Writing Help

20 Jan 2018, 19:36

Mast can u private message me please?

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 10 guests