Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 00:46

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



1 hotkey 2 diff commands?

Discussion on 1 hotkey 2 diff commands? within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Oct 2014
Posts: 7
Received Thanks: 0
1 hotkey 2 diff commands?

Hello.
Code:
;Hotkeys
While 1
Hotkeyset("{NUMPAD1}", "com1")
WEnd

Func com1()
   Send("{ENTER}")
   Send("/com1 ON")
   Send("{ENTER}")
EndFunc
is it possible to make it like that my numpad1 can use 2 diff commands?


1st press = /com1 on
2nd press = /com2 off
3rd press = /com3 on

and so on :S

you guys would rlly help me ! THX
fikkifuk is offline  
Old 11/01/2014, 20:30   #2
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
Use a variable which counts how often you've tapped.
alpines is offline  
Thanks
1 User
Old 11/01/2014, 20:34   #3
 
elite*gold: 0
Join Date: Oct 2014
Posts: 7
Received Thanks: 0
ty but i rlly dont know how to make it yet just started autoit yesterday :S
fikkifuk is offline  
Old 11/01/2014, 20:42   #4
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
I guess this will fit well
Code:
Global $iPress
HotKeySet("{NUMPAD1}", "com1")

While Sleep(100)
WEnd

Func com1()
	Switch $iPress
		Case 0
			Send("{ENTER}/com1 ON{ENTER}")
			$iPress += 1

		Case 1
			Send("{ENTER}/com2 OFF{ENTER}")
			$iPress += 1

		Case 2
			Send("{ENTER}/com3 ON{ENTER}")
			$iPress -= 2
	EndSwitch
EndFunc
alpines is offline  
Old 11/01/2014, 21:08   #5
 
elite*gold: 0
Join Date: Oct 2014
Posts: 7
Received Thanks: 0
thanks

its working i edited a bit though.

Code:
;Hotkeys
While 1
Global $iPress
Hotkeyset("{NUMPAD1}", "ghost")
Hotkeyset("{NUMPAD2}", "destribute")
WEnd


Func ghost()
	Switch $iPress
		Case 0
			Send("{ENTER}/gm ghostmode ON{ENTER}")
			$iPress += 1
            sleep(1000)
		Case 1
			Send("{ENTER}/gm ghostmode OFF{ENTER}")
			$iPress -= 1
			sleep(1000)
	EndSwitch
EndFunc


Func destribute()
   send("{ENTER}/gm destribute{ENTER}")
   sleep(300)
   EndFunc
fir what is Global $iPress?
fikkifuk is offline  
Old 11/01/2014, 21:11   #6
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
Wtf, you don't need to set 24/7 these HotKeys, set them once and sleep then.
Otherwise you have a high cpu usage.

The Global $iPress declares a global variable with the content 0.
alpines is offline  
Old 11/01/2014, 21:13   #7
 
elite*gold: 0
Join Date: Oct 2014
Posts: 7
Received Thanks: 0
oh thanks again xD im still a noobie

if i dont while them the script doesnt work o.o
fikkifuk is offline  
Old 11/01/2014, 21:19   #8
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
Code:
;Hotkeys
Global $iPress
Hotkeyset("{NUMPAD1}", "ghost")

Hotkeyset("{NUMPAD2}", "destribute")
While Sleep(100)
WEnd


Func ghost()
	Switch $iPress
		Case 0
			Send("{ENTER}/gm ghostmode ON{ENTER}")
			$iPress += 1
            sleep(1000)
		Case 1
			Send("{ENTER}/gm ghostmode OFF{ENTER}")
			$iPress -= 1
			sleep(1000)
	EndSwitch
EndFunc


Func destribute()
   send("{ENTER}/gm destribute{ENTER}")
   sleep(300)
EndFunc
alpines is offline  
Old 11/01/2014, 21:29   #9
 
elite*gold: 0
Join Date: Oct 2014
Posts: 7
Received Thanks: 0
thanks again

is there also a way to make a new hotkey menu ? for example if i make a hotkey
numpad3 it writes /gm callmonster

then i wanna use diff numbers numb 1 = 1 numb 2 = 2 and so on

but since i already used numb 1 and 2 will that work in any way?
fikkifuk is offline  
Old 11/01/2014, 21:39   #10
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
Sure, why should it be impossible?
alpines is offline  
Old 11/01/2014, 21:45   #11
 
elite*gold: 0
Join Date: Oct 2014
Posts: 7
Received Thanks: 0
cuz if i press 3 and then 1 the "ghost" func would be triggerd :S

but i want a new func for the 1 if i pressed 3
fikkifuk is offline  
Reply


Similar Threads Similar Threads
DIFF
09/11/2013 - Metin2 PServer Guides & Strategies - 1 Replies
give pls diff for SPAM game core 2089m
DIFF
08/18/2013 - Metin2 Private Server - 2 Replies
Hello epvp, give pls diff for r2089 game_core 2012(((( this not diff update 2013
Diff
04/13/2013 - Metin2 Private Server - 2 Replies
Hallo Leute ich brauche suche lange eine diff die soll das machen wenn mann stirbt kann mann schneller aufstehen..???ß;)
[Key Commands] Default Key Commands for the beginners
10/01/2008 - General Gaming Releases - 0 Replies
Default keybindings: Abilities Window V Backpack Window: B Career Window: K Character Window: C Battlegroup Window: Left Alt + R Developer Window: ; Guild Window: G Help Window: H



All times are GMT +1. The time now is 00:47.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.