Author Topic: Lua Command to bind Console Commands?  (Read 2907 times)

0 Members and 1 Guest are viewing this topic.

Offline Aqua92

  • Newbie
  • *
  • Posts: 18
  • Karma: 0
Lua Command to bind Console Commands?
« on: March 25, 2009, 11:35:34 AM »
Hey Ulysses User/Team and so on :)
I have a little Problem. I need an LUA command for gmod, Half Life CS:S and so on.

It should do the follow thing:
When i press mouse4 (i guess its mouse4) then it should do type the following to the console
"bind "mousewheel_up" "jump""

and when i press it again it should do
"bind "space" (dont know if the button called space. just the " ") "jump" like unbinding from mousewheel

So while Playing: i press the mouse4 button. Then i jump with the Mousewheel. I press it again then i jump with Space again.

Im a Lua noob. so i cant do it on my own. i can read lua but not write :/ to much in practice with c++. no time for lua.

I hope you can help me :)

Aqua

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Lua Command to bind Console Commands?
« Reply #1 on: March 25, 2009, 12:55:56 PM »
You can do this from a config, no lua required. I'll try to remember how after class..
Experiencing God's grace one day at a time.

Offline lavacano201014

  • Jr. Member
  • **
  • Posts: 83
  • Karma: 9
  • Archbishop of Cristina Scabbia worship
Re: Lua Command to bind Console Commands?
« Reply #2 on: July 06, 2009, 11:55:52 AM »
Code: [Select]
alias "WheelJump_ON" "unbind space;bind mwheelup +jump;alias WheelJumpToggle WheelJump_OFF"
alias "WheelJump_OFF" "unbind mwheelup;bind space +jump;alias WheelJumpToggle WheelJump_ON"
WheelJump_OFF
bind "mouse4" "WheelJumpToggle"

Whenever you start whatever game you plug that cfg into, it will start with Space as your jump key. Not sure those are the right keys though.
Circle reasoning works because circle reasoning works because...