Scripts
bind MOUSE1 [attack; if (|| (= (curweapon) 1) (= (curweapon) 9)) [autoreload 1] [autoreload 0]]

...or something along those lines... :P
Thanks given by:
autoreloadpistol = [ if (|| (= (curweapon) 1) (= (curweapon) 9)) [ autoreload 1 ] [ autoreload 0 ] ]

bind MOUSE1 [attack; autoreloadpistol]
Thanks given by:
Works beautifully Gibbeh... TY!
TY 2 Bukz ;)
Thanks given by:
It's the exact same thing, and I took two tries to get mine right! (stupid $curweapon vs (curweapon)).

Last thing for tonight, telehaha! Telebots is a command that teleports a bot to you, and it will always be the same bot. Put it in a recursive alias for some fun.
telehahable = 1
telehaha = [telehahable = 1; if (= $arg1 1) [telebot; sleep 1 [if $telehahable [telehaha 1]]] [ telehahable = 0 ]]

docident [telehaha] [Keep a bot in front of you using the telebot command in a recursive alias. Only works in singleplayer modes.]
docargument [B] [The telehaha state] [Indicates whether telehaha should be enabled (1) or disabled (0).]
Thanks given by:

(20 Mar 11, 02:05PM)V-Man Wrote: @Yarukinasu:
May I include your binary logarithm script in my next tools.cfg release? :D I may modify it to accept negative numbers (more for dummy-proofing than anything), but I find your method elegant.

How would accepting negative numbers (something you can't do for logs) be useful?
Thanks given by:
I made something useless again... The script looks ugly at the moment, and I may change some parts for efficiency, but I can't think much.

http://pastebin.com/CGKebfYn

To make this work, type /rave and if it's not clearly visible, type /fog 64

(24 Mar 11, 04:59AM)Viper Wrote: How would accepting negative numbers (something you can't do for logs) be useful?

Accepting negative numbers will be for "n00b-pr00f" and if a negative number is entered, it should print something like... "no negative numbers pl0x~" or something.
Thanks given by:
@Yarukinasu:
Before you go too far with that, check out the one I made. XD
I think Bukz made one that uses your concept of "building" a randomized hex value as well.

Regarding taking negative numbers, yes, I prefer that the tools be crafted in such a way that, when they receive nonsensical values, they return sane responses instead of spamming error messages, misleading results, or even throwing an exception.
Thanks given by:
I want to have script that auto-ban the user if it's below -10 and kick user if below -8
Thanks given by:
if you have admin on a server (and tools.cfg),
alias autoban [loop p 21 [if (<= (at (pstat_score $p) 1) -8) [if (<= (at (pstat_score $p) 1) -10) [ban $p] [kick $p]] []]]
add2conloop [if (currole) [autoban] []]
Though I might suggest you'll eventually want to change the threshhold ("trashhold," as Mr.Floppy says) values.
Thanks given by:
Is it possible to make a script that will use a "Hit" crosshair when you hit your enemy?
Like in Sauerbraten, there is a different crosshair for when you hit your enemy from when you miss.
Thanks given by:
Nope
Thanks given by:
(27 Mar 11, 08:34PM)Grouchy.Sal Wrote: Is it possible to make a script that will use a "Hit" crosshair when you hit your enemy?
Like in Sauerbraten, there is a different crosshair for when you hit your enemy from when you miss.

No, you have to modify your client to do that. It's impossible just with CubeScript. However, you can activate the hit sound in menu-->settings-->Gameplay Settings.
Thanks given by:
Ok, thank you!
I've always wondered if that was possible.
Thanks given by:
it is possible.
Thanks given by:
macm you poor cheater :D
Thanks given by:
(27 Mar 11, 11:32PM)macm Wrote: it is possible.

listen_for_hit = [
  my_pstat_weap = (pstat_weap (findcn $curname))
  if (checkalias old_pstat_weap) [
    if (! (strcmp $my_pstat_weap $old_pstat_weap)) [
      curweapindex = (+ (* (curweapon) 2) 1)
      if (> (at $my_pstat_weap $curweapindex) (at $old_pstat_weap $curweapindex)) [
        loadcrosshair dot_wide-hit.png // replace this with the "hit" crosshair
        sleep 100 [
          loadcrosshair dot_wide.png // the default crosshair
          loadcrosshair teammate.png teammate
          loadcrosshair red_dot.png scope ] ] ] ]
  old_pstat_weap = $my_pstat_weap
  sleep 0 listen_for_hit ]

Use the addcheck_msa listen_for_hit if the tools.cfg is available, or type add2alias mapstartalways listen_for_hit in the game.
Thanks given by:
I was gonna say, it is possible to use the accuracy script for input by listening for changes. I started to make a script that would automatically switch to pistol after you hit someone with sniper, but i realized somebody would probably call it cheating.
Thanks given by:
(28 Mar 11, 01:08AM)Lantry Wrote: I was gonna say, it is possible to use the accuracy script for input by listening for changes. I started to make a script that would automatically switch to pistol after you hit someone with sniper, but i realized somebody would probably call it cheating.

Also, weapon switching must be keybound, so you'd be hopeless anyways
Thanks given by:
yep. great ideas are almost never practical ones.
Thanks given by:
(28 Mar 11, 12:52AM)Yarukinasu Wrote: ***snipped***
Use the addcheck_msa listen_for_hit if the tools.cfg is available, or type add2alias mapstartalways listen_for_hit in the game.

Very cool.
Thanks given by:
Very busy. XD
Keep it up, though, I'm curious as to how many lengthy scripts the conloop can handle before slowing down or breaking.
Thanks given by:
IF My guess is right, it will be about 30000 scripts or less
Thanks given by:
Prove it. XD
Thanks given by:
Can anyone give me a script that resets my accuracy after every end of a game.
Thanks given by:
Go into AC and type
/add2alias start_intermission [sleep 500 [accuracyreset]]

The sleep is there in case you have autoscreenshot enabled. I like it when my accuracy stats are in my screenshots.
Thanks given by:
^Type that every time you load AC.
Otherwise you can put it in your autoexec.cfg file.
Thanks given by:
And watch as your saved.cfg mysteriously continues to grow and grow and grow! XD

...but really you should do some sanity checking even for something simple like this, add:

if (! (strstr $start_intermission accuracyreset)) [add2alias start_intermission [sleep 500 [accuracyreset]]]

... to your /config/autoexec.cfg
Thanks given by:
Oh. LOL!
I thought it was "addcheck_si"
XD
Get the tools and it will look like this:
addcheck_si [sleep 500 [accuracyreset]]
Thanks given by:
Better to have it in maploadalways really...
Thanks given by:
/addOnLoadAlways [accuracyreset]
But he asked for "after every match"!
Thanks given by: