[GUIDE] How to Use Binds
#11
(04-25-2014, 12:04 AM)Positive Wrote:
(04-24-2014, 02:55 PM)Floodify Wrote: Nice guide.

But.. Is it possible to bind two commands to one key?

This used to work for me:
bind H "act_dance; say hi"

Was just about to post this myself. Not sure if you can bind multiple say commands together. It appears to be that you used to be able to in previous GMod versions with a wait command but that doesn't work anymore.

Also you may want to add the list of bindable keys.



Spoiler :
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
` (Left quote/tilde)
' (Right quote)
- (Hyphen)
= (Equals sign)
] (Right Bracket)
\ (Forward Slash)
, (Comma)
/ (Back Slash)
SPACE
ENTER
ESCAPE
PAUSE
BACKSPACE
TAB
SEMICOLON
SHIFT
CTRL
ALT
UPARROW
DOWNARROW
LEFTARROW
RIGHTARROW
INS (Insert)
HOME
PGUP (Page up)
PGDN (Page down)
DEL
END
Number pad:
KP_HOME (7)
KP_UPARROW (8)
KP_DOWNARROW (2)
KP_LEFTARROW (4)
KP_RIGHTARROW (6)
KP_PGUP (9)
KP_PGDOWN (3)
KP_5
KP_SLASH
KP_MINUS
KP_ENTER
KP_MULTIPLY
KP_SLASH
KP_INS (0)
KP_DEL
Mouse:
MWHEEL3 (Press mousewheel)
MWHEELUP (Mouse wheel scroll up)
MWHEELDOWN (Mouse wheel scroll down)


The following 1 user Likes GRiiM's post:
  • ArcHammer
#12
(04-25-2014, 12:04 AM)Positive Wrote:
(04-24-2014, 02:55 PM)Floodify Wrote: Nice guide.

But.. Is it possible to bind two commands to one key?

This used to work for me:
bind H "act_dance; say hi"

Hmm, so you can do it, if you add a semicolon? Would someone be able to confirm this?

Thank you everyone for contributing to this guide. It's really improving it!
I'll add the info about the 'multiple binds' thing, and that it can only be for separate commands (can't do a line of 'say' commands in a row)

Sincerely,
ArcHammer
[Image: LkB62ld.png]

+Rep
#13
It seems to be able to do other commands okay
(eg. bind m "ent_create npc_zombie; ent_create npc_zombie; ent_create npc_zombie; ent_create npc_zombie; say Bring on the apocalypse!")
Will create 4 zombies and then do the say command just fine.

However bind m "say Testing 1; say Testing 2" will only write Testing 1 in the chat.
The following 1 user Likes GRiiM's post:
  • ArcHammer
#14
(04-25-2014, 12:39 AM)GRiiM Wrote: It seems to be able to do other commands okay
(eg. bind m "ent_create npc_zombie; ent_create npc_zombie; ent_create npc_zombie; ent_create npc_zombie; say Bring on the apocalypse!")
Will create 4 zombies and then do the say command just fine.

However bind m "say Testing 1; say Testing 2" will only write Testing 1 in the chat.

I should think using the 'act' commands in multiple lines would only do the first one too, right?
As for this guide, it's only for Fearless and only the admins can spawn in those entities anyway, so I won't bother to put that bit in.

Sincerely,
ArcHammer
[Image: LkB62ld.png]

+Rep
#15
Ah this guide is perfect!
#16
What if had extra keys on my keyborad? like the M1 M2 M3 and so on keys? how do I bind those?
#17
(04-25-2014, 06:58 PM)MrSnow Wrote: What if had extra keys on my keyborad? like the M1 M2 M3 and so on keys? how do I bind those?

What I do is take out my fading door tool and bind the door to my extra key (ex. M1). If you look to the left where it shows what key your fading door is bound to, take note of it and do that for 'bind KEYHERE'. I hope i explained it correctly :|
The following 2 users Like Ex7reMeFx's post:
  • GRiiM, ArcHammer
#18
(04-25-2014, 06:58 PM)MrSnow Wrote: What if had extra keys on my keyborad? like the M1 M2 M3 and so on keys? how do I bind those?

What I do is take out my fading door tool and bind the door to my extra key (ex. M1). If you look to the left where it shows what key your fading door is bound to, take note of it and do that for 'bind KEYHERE'. I hope i explained it correctly :|
[/quote]

What Ex7reMe said, that's a good way of doing it. (I have G buttons on mine, it'd be interesting to see what they are called), but yeah - for any custom buttons, it'll have a different name, other than just what it's called on the keyboard.

Sincerely,
ArcHammer
[Image: LkB62ld.png]

+Rep
#19
Tidied it up a little bit and added spoilers so the thread isn't so long when you first open it up.

Sincerely,
ArcHammer
[Image: LkB62ld.png]

+Rep
#20
Okay, so I've spent some time messing around further with binds to bypass the limitations within Garry's Mod, especially macro keys which aren't recognized in Garry's Mod.
So far I've managed to get it working so that macro keys work within Garry's Mod and also multiple lines of text can be sent with one key press but there's a lot more that can be done.
To achieve this I use some software called 'AutoHotKey'.

Here's the code I use to post two lines of Miranda rights with one key-press:

Code:
#NoEnv

text1 =
(
You have the right to remain silent. Anything you say or do can and will be held against you in the court of law.
)
Send, y
sleep, 100
sendinput %text1%
sleep, 100
Send, {enter}

sleep, 600
text2 =
(
You have the right to an attorney. If you cannot afford an attorney, one will be appointed to you.
)
Send, y
sleep, 100
sendinput %text2%
Send, {enter}

ExitApp

More information: http://www.fearlessrp.net/showthread.php?tid=48263
The following 1 user Likes GRiiM's post:
  • ArcHammer


Forum Jump:


Users browsing this thread: 1 Guest(s)