Added 'strcmp' script command.

Signed-off-by: Euphy <euphy.raliel@rathena.org>
This commit is contained in:
Euphy 2014-01-13 19:07:01 -05:00
parent b92b6be5b5
commit d569d288bd
4 changed files with 29 additions and 12 deletions

View File

@ -3,7 +3,7 @@
//===== By: ================================================== //===== By: ==================================================
//= rAthena Dev Team //= rAthena Dev Team
//===== Last Updated: ======================================== //===== Last Updated: ========================================
//= 20140111 //= 20140113
//===== Description: ========================================= //===== Description: =========================================
//= A reference manual for the rAthena scripting language. //= A reference manual for the rAthena scripting language.
//= Commands are sorted depending on their functionality. //= Commands are sorted depending on their functionality.
@ -7034,7 +7034,7 @@ mes axtoi("11"); // Displays 17 (1 = 1, 10 = 16)
--------------------------------------- ---------------------------------------
*compare(<string>,<substring>) *compare("<string>","<substring>")
This command returns 1 or 0 when the substring is in the main string (1) or not (0). This command returns 1 or 0 when the substring is in the main string (1) or not (0).
This command is not case sensitive. This command is not case sensitive.
@ -7050,6 +7050,15 @@ Examples:
--------------------------------------- ---------------------------------------
*strcmp("<string>","<string>")
This command compares two strings are returns a value:
1: string 1 > string 2
0: strings are equal
-1: string 1 < string 2
---------------------------------------
*getstrlen("<string>") *getstrlen("<string>")
This function will return the length of the string given as an argument. It is This function will return the length of the string given as an argument. It is

View File

@ -3,7 +3,7 @@
//===== By: ================================================== //===== By: ==================================================
//= rAthena Dev Team //= rAthena Dev Team
//===== Current Version: ===================================== //===== Current Version: =====================================
//= 2.1 //= 2.2
//===== Compatible With: ===================================== //===== Compatible With: =====================================
//= rAthena Project //= rAthena Project
//===== Description: ========================================= //===== Description: =========================================
@ -116,6 +116,9 @@ prontera,130,213,5 script Riding Creature Master 105,{
mes "I'm here to provide Rune Knights and Royal Guards with riding creatures."; mes "I'm here to provide Rune Knights and Royal Guards with riding creatures.";
close; close;
} }
geffen,100,55,3 duplicate(Riding Creature Master) Riding Creature Master#2 105
payon,166,102,5 duplicate(Riding Creature Master) Riding Creature Master#3 105
aldebaran,133,109,5 duplicate(Riding Creature Master) Riding Creature Master#6 105
// Peco removing NPC // Peco removing NPC
//============================================================ //============================================================
@ -208,9 +211,3 @@ dicastes01,187,207,3 duplicate(mgm) Magic Gear Master#dic 105
manuk,273,212,5 duplicate(mgm) Magic Gear Master#man 105 manuk,273,212,5 duplicate(mgm) Magic Gear Master#man 105
splendide,180,174,5 duplicate(mgm) Magic Gear Master#spl 105 splendide,180,174,5 duplicate(mgm) Magic Gear Master#spl 105
mid_camp,242,243,3 duplicate(mgm) Magic Gear Master#mid 105 mid_camp,242,243,3 duplicate(mgm) Magic Gear Master#mid 105
// Riding Creature duplicates
geffen,100,55,3 duplicate(Riding Creature Master) Riding Creature Master#2 105
payon,166,102,5 duplicate(Riding Creature Master) Riding Creature Master#3 105
aldebaran,133,109,5 duplicate(Riding Creature Master) Riding Creature Master#6 105

View File

@ -3,7 +3,7 @@
//===== By: ================================================== //===== By: ==================================================
//= rAthena Dev Team //= rAthena Dev Team
//===== Current Version: ===================================== //===== Current Version: =====================================
//= 1.7 //= 1.8
//===== Compatible With: ===================================== //===== Compatible With: =====================================
//= rAthena Project //= rAthena Project
//===== Description: ========================================= //===== Description: =========================================
@ -113,11 +113,11 @@ ma_in01,67,13,5 shop Armor Dealer#ma 536,2211:-1,2401:-1,2403:-1,2501:-1,2503:-1
// Prontera // Prontera
//======================================================= //=======================================================
//prontera,104,88,5 shop Stuff Gimme 880,616:-1 //prontera,104,88,5 shop Stuff Gimme 880,616:-1
prontera,96,209,4 shop Rebellion Accessory M 564,13210:-1,13211:-1,13212:-1,7663:-1,7664:-1,7665:-1,7940:300,13200:-1,13201:-1,13202:-1,13203:-1,13204:-1,13205:-1,13206:-1,13207:-1
prontera,92,209,4 shop Rebellion Weapons M 564,13120:-1,13122:-1,13189:-1,13190:-1,13192:-1,13193:-1,13194:-1,13197:-1,13198:-1,28200:-1,28201:-1
prt_in,109,68,4 shop Trap Specialist#prt 66,7940:-1,12341:-1 prt_in,109,68,4 shop Trap Specialist#prt 66,7940:-1,12341:-1
prt_in,175,137,4 shop Black Marketeer#prt 49,2139:-1,2800:-1,2801:-1,2802:-1,2803:-1,2804:-1,2805:-1,2806:-1,2807:-1,18000:-1,18001:-1,18002:-1,18003:-1,18004:-1,12392:-1,12393:-1,12394:-1,6145:-1,6146:-1,6147:-1,6186:-1,2808:-1 prt_in,175,137,4 shop Black Marketeer#prt 49,2139:-1,2800:-1,2801:-1,2802:-1,2803:-1,2804:-1,2805:-1,2806:-1,2807:-1,18000:-1,18001:-1,18002:-1,18003:-1,18004:-1,12392:-1,12393:-1,12394:-1,6145:-1,6146:-1,6147:-1,6186:-1,2808:-1
s_atelier,17,110,1 shop Part-Timer#sc_prt 67,6123:-1,6120:-1 s_atelier,17,110,1 shop Part-Timer#sc_prt 67,6123:-1,6120:-1
prontera,96,209,4 shop Rebellion Accessories 564,13210:-1,13211:-1,13212:-1,7663:-1,7664:-1,7665:-1,7940:300,13200:-1,13201:-1,13202:-1,13203:-1,13204:-1,13205:-1,13206:-1,13207:-1
prontera,92,209,4 shop Rebellion Weapons 564,13120:-1,13122:-1,13189:-1,13190:-1,13192:-1,13193:-1,13194:-1,13197:-1,13198:-1,28200:-1,28201:-1
//======================================================= //=======================================================
// Rachel // Rachel

View File

@ -14767,6 +14767,16 @@ BUILDIN_FUNC(compare)
return SCRIPT_CMD_SUCCESS; return SCRIPT_CMD_SUCCESS;
} }
BUILDIN_FUNC(strcmp)
{
const char *str1;
const char *str2;
str1 = script_getstr(st,2);
str2 = script_getstr(st,3);
script_pushint(st,strcmp(str1, str2));
return SCRIPT_CMD_SUCCESS;
}
// [zBuffer] List of mathematics commands ---> // [zBuffer] List of mathematics commands --->
BUILDIN_FUNC(sqrt) BUILDIN_FUNC(sqrt)
{ {
@ -18621,6 +18631,7 @@ struct script_function buildin_func[] = {
BUILDIN_DEF(countstr,"ss?"), BUILDIN_DEF(countstr,"ss?"),
BUILDIN_DEF(setnpcdisplay,"sv??"), BUILDIN_DEF(setnpcdisplay,"sv??"),
BUILDIN_DEF(compare,"ss"), // Lordalfa - To bring strstr to scripting Engine. BUILDIN_DEF(compare,"ss"), // Lordalfa - To bring strstr to scripting Engine.
BUILDIN_DEF(strcmp,"ss"),
BUILDIN_DEF(getiteminfo,"ii"), //[Lupus] returns Items Buy / sell Price, etc info BUILDIN_DEF(getiteminfo,"ii"), //[Lupus] returns Items Buy / sell Price, etc info
BUILDIN_DEF(setiteminfo,"iii"), //[Lupus] set Items Buy / sell Price, etc info BUILDIN_DEF(setiteminfo,"iii"), //[Lupus] set Items Buy / sell Price, etc info
BUILDIN_DEF(getequipcardid,"ii"), //[Lupus] returns CARD ID or other info from CARD slot N of equipped item BUILDIN_DEF(getequipcardid,"ii"), //[Lupus] returns CARD ID or other info from CARD slot N of equipped item