Author Topic: Binds. And vars.  (Read 3208 times)

Roanoke

  • Posts: 260
  • Turrets: +20/-22
Binds. And vars.
« on: November 26, 2008, 03:26:57 am »
To save typing on my binds, I used seta to make variables through which I buy stuff I always do. Here is a specific problem.
Code: [Select]
//Buying vars
seta arm "buy bsuit; buy larmour; buy helmet;" //Choose armor
seta weapons "buy rifle;" //Weapon failsafe
seta def "sell weapons; sell upgrades;" //Reset everything

//Buying Binds
bind f3    "res; arm; weapons; echo Rifle loaded." //Offensive
It tells me that 'You can't carry multiple items of the same type' or something. Yes, bsuit does not work with larmour, but neither the bsuit nor the larmour is bought. Ideally, the bsuit would be bought if possible, otherwise a larmour and helmet.

Superpie

  • Spam Killer
  • *
  • Posts: 339
  • Turrets: +105/-48
    • superpie.org
Re: Binds. And vars.
« Reply #1 on: November 26, 2008, 04:24:56 am »
Code: [Select]
//Buying vars
seta arm "buy bsuit;wait;buy larmour;buy helmet;" //Choose armor
seta weapons "buy rifle;" //Weapon failsafe
seta def "sell weapons; sell upgrades;" //Reset everything

//Buying Binds
bind f3    "vstr res;vstr arm;vstr weapons; echo Rifle loaded. Superpie rocks." //Offensive
« Last Edit: November 26, 2008, 04:28:25 am by Superpie »
Where is the good in goodbye? -Meredith Willson

Roanoke

  • Posts: 260
  • Turrets: +20/-22
Re: Binds. And vars.
« Reply #2 on: November 26, 2008, 04:29:01 am »
Hm, thanks, I'll try that out.
Edit: Works, but I get several lines of 'Must be near a powered armory' when I exec the file because of the seta lines.
« Last Edit: November 26, 2008, 04:39:40 am by Roanoke »

Superpie

  • Spam Killer
  • *
  • Posts: 339
  • Turrets: +105/-48
    • superpie.org
Re: Binds. And vars.
« Reply #3 on: November 26, 2008, 04:41:49 am »
I wasn't quite sure why you used seta, I haven't had to find a use for it. Replace 'seta' with 'set' and it should work fine, I just didn't mess with it because I thought you had used it for a reason.
Where is the good in goodbye? -Meredith Willson

Roanoke

  • Posts: 260
  • Turrets: +20/-22
Re: Binds. And vars.
« Reply #4 on: November 26, 2008, 04:48:28 am »
Now it's changed to 'must be living to use this command.'

Bissig

  • Posts: 1309
  • Turrets: +103/-131
Re: Binds. And vars.
« Reply #5 on: November 26, 2008, 08:37:24 pm »
Typical spelling error (no semicolon at the end of vstrs please(!) and mixed up variable names):

Quote
//Buying vars
seta arm "buy bsuit;wait;buy larmour;buy helmet"   //Choose armor
seta weapons "buy rifle;"            //Weapon failsafe
seta def "sell weapons; sell upgrades;"      //Reset everything

//Buying Binds
bind f3    "vstr res;vstr arm;vstr weapons; echo Rifle loaded. Superpie rocks."   //Offensive

It is either "res" or "def". Seemed as if you changed your mind inbetween writing those two vstrs.

Also, the vstr "weapons" makes no sense at all.

My suggestion:

bind f7 "vstr choosearmor"
set choosearmor "vstr armor1"
set armor1 "sell upgrades; buy bsuit; echo Battlesuit bought; set choosearmor vstr armor2"
set armor2 "sell upgrades; buy larmor; buy helmet; echo Light armor set bought; set choosearmor vstr armor1"

Roanoke

  • Posts: 260
  • Turrets: +20/-22
Re: Binds. And vars.
« Reply #6 on: November 26, 2008, 11:56:22 pm »
That's old code, so res and def are one in my current code.
I think I can live with errors.