Welcome Guest ( Log In | Register )

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Closed TopicStart new topic
> Function List, List and explinations
post Apr 11 2009, 01:10 AM
Post #1

The following post is supplementry information

Group: Global Moderators
Posts: 2,922
Joined: 29-January 06
From: Eugene Oregon
Member No.: 31

%functionname (non-optional-argument,[Optional argument] = Default of the optional argument)


Rounds a number to the Xth decimal.
%round(22.1234,1) -> 22.1

%if (TEST,True Response,[False Response] = NULL)

The most powerful function of all. A simple if statement, similar to the popular IIF function.

%ifnot (TEST,False Response,[True Response] = NULL)

Same as %if only backwards.

%switch (Compare String,String,Response,[String],[Response] - ETC) - Often understood as a PARAM ARRAY

Attempts to copy the Switch method - available in most programming languages
A very handy function.
!addcc pickgame 10 %switch(%rand(1,3),1,Starcraft,2,Diablo,3,Warcraft)

%for (START,STOP,STRING TO SAY,[Variable to replace with Number] = %i)

%i is default, but you can have it replace any string to be replaced with the number.
Functions are nested and executed correctly as of 1.6
!addcc dofor 10 Look! I can count to 4!: %for(1,4,%i)


Picks a number between LOWEST and HIGHEST randomly.


%ucase(i'm not yelling); returns I'M NOT YELLING


%lcase(NOT YELLING!); returns not yelling!

%mid (STRING,START,[HOW DEEP]) - {This function may be upgraded to mimic PHP's StrStr function}

Mimics VBs's Mid function.


%item(hello world,2); returns "world"


The opposite of %item, this function instead of picking one out, it removes one out.
%xitem (hello world,2); returns "hello"


Mimics the VBs Replace function;
%replace(hexxo world,x,l); returns hello world


%count(HELLO,L); returns 2

%instr (STRING,SEARCH,[Ignore Case] = true)

Returns the amount of characters between the start and the first sighting of SEARCH


Returns the amount of chars in String.


Mimics VBs's Chr function (Found in almost any programming language)
Used to create any character. Valid entries 0-255

%[email protected] (USERNAME)

Removes the # or @ suffix at the end of a username.
[email protected] -> Bob

%var (DL NAME,[LOCATION ENTRY] = main)

AKA %getdl returns the variable. See %setvar and %withvar


Mimics StealthBot's GetInternalDataByUsername

%now([Seconds from current time] = 0)

Returns the time - A number can be used to add to to the current time - negative numbers allowed.
- Also note, a time/date can be used in the %if function to compare 2 different times.
Very useful if you store a time in a variable, and then wish to compare it later.

%secf (SECONDS)

Seconds to Full. 60 = 1:00.
2147 = 35:47
- For use with the %gid function
!addcc lasttalked 10/ %if(%getgid(%1, 7) = -5,"%1" is not in channel!,%1 Last talked %secf(%getgid(%1, 7)) ago.

%listout (List Name, [Custom Output seperator])

Outputs the content in a list entirely.
Custom Output style has 3 variables:
## The numerical position
#R The position in Roman-Numerals, I.E. I: II: III:
#A The position in alphabetical letters, I.E. A: B: C:
%listout(MyList, #R. )
%listout(MyList, #A. )

%listitem(List Name, Item Position)

Returns the item in defined position

%listsize(List Name)

Returns the amount of items in the list.


Returns the amount of wins that Username has (Applys to Starcraft and WC2)


Does the math.
%math(1+1); returns 2

PRIORITY 2 Functions:

The following lists Priority 2 functions
These functions all 'do' something - like set data or change a setting. They execute only after all Priority 1 functions have.


This function acts like PHP's die. It will respond with the arguments, and everything else is ignored.
!addcc TestDie 10 %if(%user<>Snap,%die(This CC will only work for Snap))Hi Snap I Wuv your CC System!
This CC will only work for Snap
Hi Snap I Wuv your CC System

%runcc (Custom Command Name)

Runs the command - if the user has enough access to use that command.


AKA %setdl
Sets a var to be recalled with %var.


AKA %withdl
Uses a operator to apply a concatenation, or a mathematical operation.
& - Appends to.
%withvar(MYVAR,& World)
%var(MYVAR) now contains Hello World

+ Addition
* Multiplecation
/ Division
^ Power
MOD Modulo Division

Currently, Subtraction is done with the use of negative numbers. Also - you can't currently divide in both directions. 1.91.

%listadd(List Name, Data to add,[Show Position] = false)

Adds an entry to a list. If Show position is true - it will return that number.

%listdel(List Name,Position or String to delete)

Deletes the list item - found by position or string.
[This is currently buggy in versions 1.91 and below - the revisit to this function should include an optional 'return position' of item deleted]

%listclear (List Name)

Clears the list of all items.

List as of 1.91;
These are how the functions Should work.

List last modified 04/11/09

~Life is all busy and stuff right now. - Car accident, lots of dr. appointments... Other stuff too. I still <3 StealthBot.net - - I'll be around.
Thinking about PMing me? Post it instead! CCX Forums | SnapNJacks Trivia Forums
IPB Image
IPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


- Lo-Fi Version Time is now: 13th July 2020 - 03:06 AM
Skin by Andrea
Website Legal Information | Hosted by LunarPages