| 
		
	
	
	
		
	Posts: 1,718Threads: 169
 Joined: Jun 2010
 
	
		
		
		26 Jan 11, 11:20PM 
(This post was last modified: 26 Jan 11, 11:24PM by MykeGregory.)
		
	 
		teabagging script? 
the right guy here... not for scripting, but for bagging.
 
EDIT: If you bind capslock as crouch, when you hit it you will stay crouched.
	
		
	 
	
	
	
		
	Posts: 3,462Threads: 72
 Joined: Jun 2010
 
	
	
		It is currently impossible to make a t-bag script.
		
	 
	
	
	
		
	Posts: 523Threads: 6
 Joined: Dec 2010
 
	
		
		
		27 Jan 11, 03:15AM 
(This post was last modified: 27 Jan 11, 03:16AM by VenteX.)
		
	 
		 (26 Jan 11, 07:54PM)DES|V-Man Wrote:  VenteX is disappointed that he didn't get credit for the idea to have the vote sound in CAPSLOCK. All I did was put the numbers in. 
The ability of V-Man to read my mind and reply with exactly what I was about to say before I say it is really starting to amaze me. And worry me a bit O_O
	 
		
	 
	
	
	
		
	Posts: 3,780Threads: 33
 Joined: Jun 2010
 
	
	
		Here, anyone else who wants it can have it: alias ReadMind [alias tmp 0
 if (strcmp $arg1 "VenteX") [
 loop i 42 [add2list tmp (at $VenteX $i)]
 alias VenteX_mind (getalias tmp)
 ] []
 result $VenteX_mind
 ]
Then I just use /ReadMind VenteX...
	
		
	 
	
	
	
		
	Posts: 3,780Threads: 33
 Joined: Jun 2010
 
	
	
		Anyone who read this post  will realize why these latest scripts are so exciting for me. 
So... Thanks to Drakas for the inspiration!
 replacestralias replacestr [delalias tmp_list5
 loop rs (listlen $arg1) [
 if (strcmp (at $arg1 $rs) $arg2) [add2list tmp_list5 $arg3] [add2list tmp_list5 (at $arg1 $rs)]
 ]
 result $tmp_list5
 ] // replacestr [I do not like CubeScript] "not" "really"
 
 alias swapstrpos [
 delalias tmp_list6
 alias strpos1 (findlist $arg1 $arg2)
 alias strpos2 (findlist $arg1 $arg3)
 loop sw (listlen $arg1) [
 if (= $sw $strpos1) [add2list tmp_list6 $arg3] [
 if (= $sw $strpos2) [add2list tmp_list6 $arg2] [
 add2list tmp_list6 (at $arg1 $sw)]]
 ]
 result $tmp_list6
 ] // swapstrpos [I do really like CubeScript] "do" "really"
 - replaces a given string in a given list with another string
swapstrpos  - swaps the two positions of two given strings in a given list
	
		
	 
	
	
	
		
	Posts: 1,331Threads: 44
 Joined: Jun 2010
 
	
		
		
		28 Jan 11, 08:07PM 
(This post was last modified: 29 Jan 11, 04:16AM by Bukz.)
		
	 
		Akimbo countdown/cursecondary script: // Got akimbo/akimbo powerup countdown script by DES|Bukz// Requires tools.cfg
 initialize [gotaki akicountdown] 0
 
 add2conloop [
 if (= (curweapon) 9) [
 if $gotaki [] [gotaki = 1; if (&& (= $akicountdown 1) (!= (currentprimary) 5)) [initcountdown] []; sleep 30001 [gotaki = 0]]
 ] []
 ]
 
 alias sleeplist [0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 11000 12000 13000 14000 15000 16000 17000 18000 19000 20000 21000 22000 23000 24000 25000 26000 27000 28000 29000 30000]
 
 alias initcountdown [
 alias intcounter 30
 loop akiloop 30 [
 sleep (at $sleeplist $akiloop) [
 -= intcounter 1
 if (> $intcounter 19) [
 echo (c 0) $intcounter
 ] [
 if (> $intcounter 9) [
 echo (c 2) $intcounter
 ] [
 echo (c 3) $intcounter
 ]
 ]
 ]
 ]
 ]
 
 alias akimbocountdown [
 if (= $arg1 1) [
 alias akicountdown 1
 echo (c 2)Akimbo powerup countdown (c 0)enabled!
 ] [
 alias akicountdown 0
 echo (c 2)Akimbo powerup countdown (c 3)disabled!
 ]
 ]
 
 
 // cursecondary - If the client has an akimbo available, returns 9, else returns 1.
 // Requires the "gotaki" script.
 alias cursecondary [
 if $gotaki [
 result 9
 ] [
 result 1
 ]
 ]
 
 docsection [Akimbo];
 
 docident [akimbocountdown] [If enabled, echos a countdown timer to the console upon akimbo pickup.];
 docargument [X] [1 = enabled, 0 = disabled];
 docexample [/akimbocountdown 1] [Enables the countdown.];
 
 docident [cursecondary] [Returns the index value of the clients current secondary weapon.];
 docexample [/echo (cursecondary)] [If you currently have an akimbo powerup available, outputs 9.];
Use:
 ...to enable the countdown.
 
The cursecondary command will return 9 if you have the akimbo at your disposal, else it will return 1, for the usual pistol.
 
 
Random startup messages script:
 // Random startup messages script by DES|Bukzif (checkalias rndstmsg) [] [rndstmsg = 1]
 
 alias random_messages ["*crouch* *crouch* --- Nooooooooo!" "What is this game I don't even..."]
 
 alias clearstartmessage [
 if (= $arg1 1) [
 alias random_messages []
 echo (c 2)Your list of random start up messages has been (c 3)cleared!
 ] [
 echo (c 3)clearstartmessage requires 1 as the only argument to function!
 ]
 ]
 
 alias startmessage [
 if (= $arg1 1) [
 rndstmsg = 1
 echo (c 2)Random startup messages (c 0)enabled!
 ] [
 rndstmsg = 0
 echo (c 2)Random startup messages (c 3)disabled!
 ]
 ]
 
 addOnLoadOnce [if $rndstmsg [echo (at $random_messages (rnd (listlen $random_messages)))] []]
 
 docsection [Random_Messages];
 
 docident [clearstartmessage] [Clears the list of all random startup messages.];
 docargument [X] [Must be 1 to function.];
 docexample [/clearstartmessage 1] [Clears the list.];
 
 docident [startmessage] [Enables or disables the showing of random messages on startup.];
 docargument [X] [1 = enabled, 0 = disabled];
 docexample [/startmessage 1] [Enables];
Use... ...to enable the script.
 
You must edit the first alias in the script "random_messages" to include your own personalized messages. These messages must be separated by a space, AND  wrapped in quotes "".
	
		
	 
	
	
	
		
	Posts: 119Threads: 8
 Joined: Jun 2010
 
	
	
		Akimbo Countdown! Good idea. Dammit why didn't it comes to my mind??
 
		
	 
	
	
	
		
	Posts: 1,331Threads: 44
 Joined: Jun 2010
 
	
	
		There is a flaw in it that I forgot to mention, since the akimbo does not get automatically switched to while using the sniper rifle, the script won't be so accurate for the sniper users, unless you switch to the akimbo once you've picked one up, really...really fast. :P
	 
		
	 
	
	
	
		
	Posts: 2,841Threads: 44
 Joined: Jun 2010
 
	
	
		Tough luck for the snipers xD
	 
		
	 
	
	
	
		
	Posts: 1,823Threads: 20
 Joined: Jun 2010
 
	
		
		
		29 Jan 11, 02:32AM 
(This post was last modified: 29 Jan 11, 02:32AM by Gibstick.)
		
	 
		Quickly toggle console. alias contog [if (!= $consize 0) [getconsize = $consize; consize 0] [if (> $getconsize 0) [consize $getconsize] [consize 6]]]
Bind to whatever you want using  
bind KEY contog
	
		
	 
	
	
	
		
	Posts: 1,331Threads: 44
 Joined: Jun 2010
 
	
		
		
		29 Jan 11, 03:40AM 
(This post was last modified: 29 Jan 11, 11:32PM by Bukz.)
		
	 
		Here's an updated version of Mr.Floppy's "Cleanshot" script: // Cleanshot/Clean HUD toggle script - Original script/idea by Mr.Floppy - remade/updated for AC 1.1+ by DES|Bukzalias gethudsets [
 accuracy_tmp = $accuracy
 clockdisplay_tmp = $clockdisplay
 crosshairsize_tmp = $crosshairsize
 crosshairteamsign_tmp = $crosshairteamsign
 damagescreen_tmp = $damagescreen
 hidecompass_tmp = $hidecompass
 hideconsole_tmp = $hideconsole
 hidectfhud_tmp = $hidectfhud
 hidedamageindicator_tmp = $hidedamageindicator
 hidehudequipment_tmp = $hidehudequipment
 hidehudmsgs_tmp = $hidehudmsgs
 hideradar_tmp = $hideradar
 hideteam_tmp = $hideteam
 hidevote_tmp = $hidevote
 hudgun_tmp = $hudgun
 showstats_tmp = $showstats
 ]
 
 alias hudsetslist [accuracy clockdisplay crosshairsize crosshairteamsign damagescreen hidecompass hideconsole hidectfhud hidedamageindicator hidehudequipment hidehudmsgs hideradar hideteam hidevote hudgun showstats]
 alias newhudsetslist [0 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0]
 
 alias clearhud [
 if (= $arg1 1) [
 gethudsets
 loop hudloop (listlen $newhudsetslist) [
 (at $hudsetslist $hudloop) (at $newhudsetslist $hudloop)
 ]
 ] []
 ]
 
 alias resethud [
 if (= $arg1 1) [
 loop hudloop (listlen $hudsetslist) [
 (at $hudsetslist $hudloop) (getalias (format "%1_tmp" (at $hudsetslist $hudloop)))
 ]
 ] []
 ]
 
 alias cleanshot [
 clearhud 1
 sleep 10 [screenshot]
 sleep 20 [resethud 1]
 ]
 
 // bind KEY [cleanshot]
Edit:
  BTW, I updated the akimbo countdown script  to NOT countdown if your current primary weapon is the sniper rifle.
	
		
	 
	
	
	
		
	Posts: 3,780Threads: 33
 Joined: Jun 2010
 
	
	
		Thanks Bukz, another script I can take off my to-do list. :D 
And now for some more of my abstract scripts yay!
 serialalias serial [tmp_command = $arg3
 serialnum = 0
 loop sa $arg2 [
 alias (concatword $arg1 $sa) (tmp_command)
 += serialnum 1
 ]
 ] // serial (base name) (number to make) [meta-command]
 // Uses $serialnum as its counting variable
 
 alias nestalias [
 tmp_name = $arg1
 tmp_layers = $arg2
 tmp_command = $arg3
 nestnum = 0
 tmp_alias = (alias $tmp_name [])
 loop nn $tmp_layers [
 tmp_alias = (concat "alias" $tmp_name "[" $tmp_alias "]" ";" (tmp_command))
 += nestnum 1
 ]
 alias $tmp_name $tmp_alias
 ] // nestalias (alias name) (number of layers) [side meta-command]
 // Uses $nestnum as its counting variable
 - creates a series of aliases with similar names and similar content
nestalias  - creates a "nested" alias -- one that redefines itself each time it is activated
	
		
	 
	
	
	
		
	Posts: 2,136Threads: 50
 Joined: Jun 2010
 
	
	
		 (29 Jan 11, 03:40AM)Bukz Wrote:  Here's an updated version of Mr.Floppy's "Cleanshot" script... You omitted the score table and accuracy stats.
	 
		
	 
	
	
	
		
	Posts: 1,718Threads: 169
 Joined: Jun 2010
 
	
		
		
		29 Jan 11, 01:40PM 
(This post was last modified: 29 Jan 11, 01:45PM by MykeGregory.)
		
	 
		/bind 0 [if $accuracy [accuracy 0; echo STATS OFF] [accuracy 1; echo STATS ON]]
This toggles your accuracy stats when 0 is pressed.
	 
		
	 
	
	
	
		
	Posts: 1,823Threads: 20
 Joined: Jun 2010
 
	
	
		// Clean screenshot.// Get current values.
 alias get_hud [
 alias get_gun $hudgun
 alias get_radar $hideradar
 alias get_team $hideteam
 alias get_vote $hidevote
 alias get_equipment $hidehudequipment
 alias get_console $hideconsole
 alias get_spect $hidespecthud
 alias get_msg $hidehudmsgs
 alias get_dmgindicator $hidedamageindicator
 alias get_dmgscreen $damagescreen)
 alias get_teamsign $crosshairteamsign
 alias get_flag $hidectfhud
 alias get_hair $crosshairsize
 alias get_accs $accuracy
 alias get_stats $showstats
 alias get_clock $clockdisplay
 ]
 
 // Disable HUD.
 alias clean_hud [
 hudgun 0
 hideradar 1
 hideteam 1
 hidevote 2
 hidehudequipment 1
 hideconsole 1
 hidespecthud 1
 hidehudmsgs 1
 hidedamageindicator 1
 damagescreen 1
 crosshairteamsign 1
 hidectfhud 1
 crosshairsize 0
 accuracy 0
 showstats 0
 clockdisplay 0
 showscores 0
 ]
 
 // Set former values.
 alias reload_hud [
 hudgun $get_gun
 hideradar $get_radar
 hideteam $get_team
 hidevote $get_vote
 hidehudequipment $get_equipment
 hideconsole $get_console
 hidespecthud $get_spect
 hidehudmsgs $get_msg
 hidedamageindicator $get_dmgindicator
 damagescreen $get_dmgscreen
 crosshairteamsign $get_teamsign
 hidectfhud $get_flag
 crosshairsize $get_hair
 accuracy $get_accs
 showstats $get_stats
 clockdisplay $getclock
 ]
 
 alias cleanshot [get_hud; sleep 10 [clean_hud]; sleep 20 [screenshot]; sleep 40 [reload_hud]]
 
		
	 
	
	
	
		
	Posts: 1,718Threads: 169
 Joined: Jun 2010
 
	
		
		
		29 Jan 11, 01:48PM 
(This post was last modified: 29 Jan 11, 01:48PM by MykeGregory.)
		
	 
		 (29 Jan 11, 01:45PM)Gibstick Wrote:   
very nice!
	 
		
	 
	
	
	
		
	Posts: 3,780Threads: 33
 Joined: Jun 2010
 
	
	
		@jamz/Bukz: 
Maybe some people want to leave the scoretable in their screenshots! 
Er... 
Maybe that's a good reason for making a menu out of this that'll allow a person to select what disappears and what is left alone in the cleanshot... just sayin'. 
Also, for those who like cleaning up after themselves:
 delserialalias delserial [loop ds $arg2 [
 delalias (concatword $arg1 $ds)
 ]
 ] // delserial (base name) (number to delete up to)
 - delete a series of aliases with similar names (differentiated by a series of numbers)
	
		
	 
	
	
	
		
	Posts: 2,136Threads: 50
 Joined: Jun 2010
 
	
	
		 (29 Jan 11, 05:15PM)V-Man Wrote:  Maybe some people want to leave the scoretable in their screenshots! Ah, you see, I was thrown off by the word clean  in the code - // Cleanshot/Clean HUD toggle... 
That's why you're the scripter V...
	 
		
	 
	
	
	
		
	Posts: 1,331Threads: 44
 Joined: Jun 2010
 
	
		
		
		29 Jan 11, 11:33PM 
(This post was last modified: 30 Jan 11, 07:53AM by V-Man.)
		
	 
		I updated my version of the cleanshot script, wouldn't that have been easier on you Gib? 9_____9
	 
		
	 
	
	
	
		
	Posts: 1,331Threads: 44
 Joined: Jun 2010
 
	
		
		
		30 Jan 11, 02:43AM 
(This post was last modified: 30 Jan 11, 03:43AM by Bukz.)
		
	 
		Heres a version of the cleanshot with a seperate command "/cstcleanshot" that will use the settings found in the "Custom Cleanshot" menu. Use: ...and select the Custom Cleanshot item to tweak these settings. Note that these settings CAN differ from your usual settings in every way, and should be saved between sessions.
 ...still takes a regular cleanshot with no HUD elements, and... ...will take a customized cleanshot using the settings found in the menu.
 // Cleanshot/Clean HUD toggle script with customizeable features + menu - Original script/idea by Mr.Floppy - remade/updated for AC 1.1+ by DES|Bukzalias gethudsets [
 accuracy_tmp = $accuracy
 clockdisplay_tmp = $clockdisplay
 crosshairsize_tmp = $crosshairsize
 crosshairteamsign_tmp = $crosshairteamsign
 damagescreen_tmp = $damagescreen
 hidecompass_tmp = $hidecompass
 hideconsole_tmp = $hideconsole
 hidectfhud_tmp = $hidectfhud
 hidedamageindicator_tmp = $hidedamageindicator
 hidehudequipment_tmp = $hidehudequipment
 hidehudmsgs_tmp = $hidehudmsgs
 hideradar_tmp = $hideradar
 hideteam_tmp = $hideteam
 hidevote_tmp = $hidevote
 hudgun_tmp = $hudgun
 showstats_tmp = $showstats
 ]
 
 alias hudsetslist [accuracy clockdisplay crosshairsize crosshairteamsign damagescreen hidecompass hideconsole hidectfhud hidedamageindicator hidehudequipment hidehudmsgs hideradar hideteam hidevote hudgun showstats]
 alias newhudsetslist [0 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0]
 
 alias clearhud [
 if (= $arg1 1) [
 gethudsets
 loop hudloop (listlen $newhudsetslist) [
 (at $hudsetslist $hudloop) (at $newhudsetslist $hudloop)
 ]
 ] []
 ]
 
 alias resethud [
 if (= $arg1 1) [
 loop hudloop (listlen $hudsetslist) [
 (at $hudsetslist $hudloop) (getalias (format "%1_tmp" (at $hudsetslist $hudloop)))
 ]
 ] []
 ]
 
 alias cleanshot [
 clearhud 1
 sleep 10 [screenshot]
 sleep 20 [resethud 1]
 ]
 
 // bind KEY [cleanshot]
 
 alias mkcsaliases [
 loop clnloop (listlen $arg1) [
 if (checkalias (at $arg1 $clnloop)) [] [alias (at $arg1 $clnloop) $arg2]
 ]
 ]
 
 alias cstcleanshotaliases [accuracy_mmp clockdisplay_mmp crosshairsize_mmp crosshairteamsign_mmp damagescreen_mmp hidecompass_mmp hideconsole_mmp hidectfhud_mmp hidedamageindicator_mmp hidehudequipment_mmp hidehudmsgs_mmp hideradar_mmp hideteam_mmp hidevote_mmp hudgun_mmp showstats_mmp]
 
 mkcsaliases $cstcleanshotaliases []
 
 alias prepcleanshot [
 if (= $arg1 1) [
 gethudsets
 loop cstcsloop (listlen $hudsetslist) [
 (at $hudsetslist $cstcsloop) (getalias (at $cstcleanshotaliases $cstcsloop))
 ]
 ] []
 ]
 
 alias cstcleanshot [
 prepcleanshot 1
 sleep 10 [screenshot]
 sleep 20 [resethud 1]
 ]
 
 // bind KEY [cstcleanshot]
 
 newmenu "Cleanshot"
 menuitemvar [concat (c 0)Regular Cleanshot] [closemenu "Cleanshot"; sleep 10 [cleanshot]]
 menuitemvar [concat (c 2)Custom Cleanshot] [showmenu "Custom Cleanshot"]
 menuitem [] -1
 menuitem [           OK] [closemenu "Cleanshot"]
 
 newmenu "Custom Cleanshot"
 menuitemcheckbox [Enable accuracy?] [$accuracy_mmp] [accuracy_mmp = $arg1]
 menuitemslider [Clock display setting: ] 0 2 [$clockdisplay_mmp] 1 ["disabled" "count backward" "count forward"] [clockdisplay_mmp = $arg1]
 menuitemslider [Crosshair size setting: ] 0 50 [$crosshairsize_mmp] 5 [] [crosshairsize_mmp = $arg1]
 menuitemcheckbox [Enable crosshair team sign?] [$crosshairteamsign_mmp] [crosshairteamsign_mmp = $arg1]
 menuitemcheckbox [Enable damage screen?] [$damagescreen_mmp] [damagescreen_mmp = $arg1]
 menuitemcheckbox [Disable compass?] [$hidecompass_mmp] [hidecompass_mmp = $arg1]
 menuitemcheckbox [Disable console?] [$hideconsole_mmp] [hideconsole_mmp = $arg1]
 menuitemcheckbox [Disable CTF icons?] [$hidectfhud_mmp] [hidectfhud_mmp = $arg1]
 menuitemcheckbox [Disable damage indicator?] [$hidedamageindicator_mmp] [hidedamageindicator_mmp = $arg1]
 menuitemcheckbox [Disable HUD equipment?] [$hidehudequipment_mmp] [hidehudequipment_mmp = $arg1]
 menuitemcheckbox [Disable HUD messages?] [$hidehudmsgs_mmp] [hidehudmsgs_mmp = $arg1]
 menuitemcheckbox [Disable radar?] [$hideradar_mmp] [hideradar_mmp = $arg1]
 menuitemcheckbox [Disable team icons?] [$hideteam_mmp] [hideteam_mmp = $arg1]
 menuitemcheckbox [Disable vote iconts?] [$hidevote_mmp] [hidevote_mmp = $arg1]
 menuitemcheckbox [Enable HUD gun?] [$hudgun_mmp] [hudgun_mmp = $arg1]
 menuitemslider [Show stats setting: ] 0 2 [$showstats_mmp] 1 ["disabled" "only FPS" "all stats"] [showstats_mmp = $arg1]
 menuitem [] -1
 menuitem [                     Take Custom Cleanshot] [closemenu "Custom Cleanshot"; sleep 5 [closemenu "Cleanshot"; sleep 10 [cstcleanshot]]
 menuitem [                               OK] [closemenu "Cleanshot Settings"]
 
 docsection [Clean HUD];
 
 docident [cleanshot] [Takes a normal cleanshot with no HUD items.];
 
 docident [cstcleanshot] [Takes a customized cleanshot using the settings found in menu "Custom Cleanshot".];
		
	 
	
	
	
		
	Posts: 1,823Threads: 20
 Joined: Jun 2010
 
	
	
		These are my binds. bind f [ if $editing [solid 1] [quicknadethrow] ]bind q [ if $editing [ domodifier 1 ] [melee; attack]] //switch to knife or attack with knife if selected
 bind MOUSE3 [if (= (curweapon) 0) [attack] [secondary; attack]] //switch to pistol or attack with pistol, if knife is selected attack with knife
 bind MOUSE1 [primary; attack] //switch to primary or attack with primary if selected
 bind MOUSE2 [ if $editing [ showmenu editing ] [ altaction ] ] //normal altaction bind
 alias delta_game_0 [ if (= $arg1 1) [melee] [secondary] ] //mouse down for pistol, mouse up for knife
		
	 
	
	
	
		
	Posts: 3,780Threads: 33
 Joined: Jun 2010
 
	
		
		
		30 Jan 11, 09:30AM 
(This post was last modified: 30 Jan 11, 09:31AM by V-Man.)
		
	 
		Ohey my favorite part was when  (26 Jan 11, 01:25AM)Bukz Wrote:  alias curscore []
 docident [curscore] [Returns the current score of a client.];
 docargument [C] [A valid client number.];
 docexample [/echo (curscore 5)] [Output: If cn 5 currently has 125 points, outputs 125.];
 docremark [Returns -1 if an invalid client number was given or if not currently connected to a server.];
 Get it? LOL it's a CubeScript joke. 
The joke is that he documented the command but it doesn't exist yet. XD
	
		
	 
	
	
	
		
	Posts: 1,331Threads: 44
 Joined: Jun 2010
 
	
		
		
		30 Jan 11, 12:30PM 
(This post was last modified: 30 Jan 11, 12:30PM by Bukz.)
		
	 
		* Bukz facepalms
Guess I forgot to add that alias in for the release. I updated the post btw. :p
 // curscore - Returns the current score (in points) that a given client has ATM by DES|Bukzalias curscore [
 if (strcmp (findpn $arg1) "") [result -1] [
 tmpscore = (at (pstat_score $arg1) 3)
 result $tmpscore
 ]
 ]
 
		
	 
	
	
	
		
	Posts: 1,331Threads: 44
 Joined: Jun 2010
 
	
		
		
		30 Jan 11, 03:41PM 
(This post was last modified: 30 Jan 11, 03:45PM by Bukz.)
		
	 
		More stuff for tools.cfg possibly :D // checkint & checkchar - Checks given arguments and determines if they are an integer or contains chars - by DES|Bukzalias lowalphalist [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]
 alias higalphalist [A B C D E F G H I J K L M N O P Q R S T U V W Z Y Z]
 alias symbollist [` ~ ! @ # $ % ^ & * - _ = + { } \ | ; : ' , < . > / ?]
 
 alias checkint [
 foundchars = 0
 loop lowloop 26 [
 if (strstr $arg1 (at $lowalphalist $lowloop)) [
 foundchars = 1
 ] []
 ]
 loop hiloop 26 [
 if (strstr $arg1 (at $higalphalist $hiloop)) [
 foundchars = 1
 ] []
 ]
 loop syloop 26 [
 if (strstr $arg1 (at $symbollist $syloop)) [
 foundchars = 1
 ] []
 ]
 if $foundchars [result 0] [result 1]
 ]
 
 alias checkchar [
 foundchars = 0
 loop lowloop 26 [
 if (strstr $arg1 (at $lowalphalist $lowloop)) [
 foundchars = 1
 ] []
 ]
 loop hiloop 26 [
 if (strstr $arg1 (at $higalphalist $hiloop)) [
 foundchars = 1
 ] []
 ]
 loop syloop 26 [
 if (strstr $arg1 (at $symbollist $syloop)) [
 foundchars = 1
 ] []
 ]
 if $foundchars [result 1] [result 0]
 ]
 
 docsection [Check];
 
 docident [checkint] [Checks a given argument and determines if it is an integer or not.];
 docargument [The string to check.];
 docexample [if (= (checkint 928593) 1) [echo 928593 is an integer] [echo 928593 is not an integer]] [Output: 928593 is an integer];
 docexample [if (= (checkint CubeScript) 1) [echo CubeScript is an integer] [echo CubeScript is not an integer]] [Output: Cubescript is not an integer];
 docremark [Returns 1 if the given argument is an integer, else returns 0.];
 
 docident [checkchar] [Checks a given argument and determines if it contains non-numerical characters.];
 docargument [The string to check.];
 docexample [if (= (checkchar adsf) 1) [echo adsf contains chars] [echo adsf does not contain chars]] [Output: adsf contains chars];
 docexample [if (= (checkchar 192) 1) [echo 192 contains chars] [echo 192 does not contain chars]] [Output: 192 does not contain chars];
 docremark [Returns 1 if the given argument contains one or more chars, else returns 0.];
		
	 
	
	
	
		
	Posts: 1,823Threads: 20
 Joined: Jun 2010
 
	
		
		
		30 Jan 11, 07:24PM 
(This post was last modified: 30 Jan 11, 09:40PM by Bukz.)
		
	 
		Check if input will behave as an integer: isint = [result (&& (!=f (divf $arg1 1) 0.0) (=f (modf $arg1 1)) 0) ]
Unfortunately, (isint 5fdsf) returns 1 because in CubeScript, 5fdsfs = 5. This works for math but not much else.
 a = 5dfsdfsb = 5
 echo (+ $a $b) //output: 10
 echo $a //output: 5dfsdfs
If you need  an integer without any junk, just add 1 and subtract 1 to the number, or use Bukz' checkint.
 a = 5fsdsfda = (- (+ $a 1) 1)
Edit: NVM don't use this as it doesn't count 0 as a number.
Bukz Edit: \:D
		
	 
	
	
	
		
	Posts: 3,780Threads: 33
 Joined: Jun 2010
 
	
	
		:D Thanks Bukz.I'll put "checkint" into tools.cfg (checkchar does the same thing, but outputs 1 or 0 reversed -- which can be accomplished using ! rather than another script).
 
		
	 
	
	
	
		
	Posts: 3,462Threads: 72
 Joined: Jun 2010
 
	
	
	
		
	Posts: 3,462Threads: 72
 Joined: Jun 2010
 
	
	
		I may mention that V-Man saw my last post and updated his scripts!Friends
pauseconline
Smooth Zoom
Rave Party
rewind
Assault Your Ears barebones
Assault Your Ears 
I'll note that I have been watching closely as he has been updating his rapidfire script. Wait and watch for a new rapid fire script soon!
	
		
	 
	
	
	
		
	Posts: 1,823Threads: 20
 Joined: Jun 2010
 
	
		
		
		31 Jan 11, 09:48PM 
(This post was last modified: 31 Jan 11, 10:05PM by Gibstick.)
		
	 
		YUSS V-Man comeback (not that he went down). 
Updated isint, works with 0.
 isint = [result (|| (&& (!=f (divf $arg1 1) 0.0) (=f (modf $arg1 1)) 0) (=f $arg1 0) ) ]
Unfortunately, isint only works for floating point numbers that have less than 8 digits before the decimal place. Therefore, 9 999 999.999... is the biggest floating point number that works with isint.
 
I always try to use the less-than-brute-force approach. Although my script seems neat and fast, C++ probably does some brute force calculations with modulo, but it's definitely not as bad as cubescript brute-forcing that Bukz uses \:D. However, my script is completely useless in validating characters themselves, so it isn't ideal for lists and etc. Bukz' script does validate the characters themselves, and this is why "5.0" returns 0 with Bukz' script. In the purest sense, 5.0 is still floating point.
 
 
Simple script to fix gamma when alt-tabbing in and out of AC, because my gamma always messes up when I do that. I can fix it by changing the gamma to anything else, and optionally setting it back. It may not work on all gfx cards. Use /fixgamma
 alias fixgamma [gamma (+ $gamma 1); gamma (- $gamma 1)]
		
	 
	
	
	
		
	Posts: 1,331Threads: 44
 Joined: Jun 2010
 
	
	
		5.0 is only floating point in math. :P
	 
		
	 |