Genesis Posted June 18, 2017 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 19 Reputation: 2 Joined: 12/01/11 Last Seen: March 30 Share Posted June 18, 2017 Hi, I was wondering if there is a way using strcharinfo(1) to determine if a party name has specific character (say "#") in the name. If so, do something. Quote Link to comment Share on other sites More sharing options...
1 Emistry Posted June 20, 2017 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: 8 hours ago Share Posted June 20, 2017 if (compare( strcharinfo(1), "#" )) { // ... } 1 Quote Link to comment Share on other sites More sharing options...
1 Rynbef Posted June 19, 2017 Group: Forum Moderator Topic Count: 48 Topics Per Day: 0.01 Content Count: 940 Reputation: 125 Joined: 05/23/12 Last Seen: Tuesday at 07:40 PM Share Posted June 19, 2017 Now Im on my wiindows pc thereforce I can leave an example for you. //.@string = are the input string set .@string,strcharinfo(1); //Name of the party for (set .@i,0; .@i<getstrlen(.@string); .@i++){ if(charat(.@string[.@i]) == "#"){ dispbottom "You have a # in your party name!"; //Or call function //Or .@specialchar++; } } //if(.@specialchar){ // mes "You have "+.@specialchar+" # in your party name."; //} end; Rynbef~ Quote Link to comment Share on other sites More sharing options...
0 Rynbef Posted June 19, 2017 Group: Forum Moderator Topic Count: 48 Topics Per Day: 0.01 Content Count: 940 Reputation: 125 Joined: 05/23/12 Last Seen: Tuesday at 07:40 PM Share Posted June 19, 2017 U can use a for loop and charat to look to every letter of a string. Firstly getcharlen(.@s) Then for loop every letter And look at every character charat(.@s[.@i]) Im on mobile thereforce I cant give u a detailed answer. I hope it will help u a lot. Rynbef~ Quote Link to comment Share on other sites More sharing options...
-1 Genesis Posted June 19, 2017 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 19 Reputation: 2 Joined: 12/01/11 Last Seen: March 30 Author Share Posted June 19, 2017 8 hours ago, Rynbef said: U can use a for loop and charat to look to every letter of a string. Firstly getcharlen(.@s) Then for loop every letter And look at every character charat(.@s[.@i]) Im on mobile thereforce I cant give u a detailed answer. I hope it will help u a lot. Rynbef~ Hi, Could you provide an example? Quote Link to comment Share on other sites More sharing options...
-1 Deleted User Posted June 20, 2017 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 235 Reputation: 55 Joined: 12/02/11 Last Seen: February 26, 2021 Share Posted June 20, 2017 Might this will help you as a script based. Credits: AnnieRURU prontera,156,188,5 script kjdfhkshfs 100,{ getpartymember getcharid(1), 1; getpartymember getcharid(1), 2; .@origin = getcharid(3); for ( .@i = 0; .@i < $@partymembercount; .@i++ ) { if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) { attachrid $@partymemberaid[.@i]; .@online++; .@compare_job$ = .@compare_job$ +"#"+ class +"#"; } } attachrid .@origin; // dispbottom .@online + .@compare_job$; if ( .@online < 5 ) mes "your party needs at least 5 party member online"; else if ( !compare( .@compare_job$, "#"+ Job_Paladin +"#" ) ) mes "your party needs a Paladin in your party"; else if ( !compare( .@compare_job$, "#"+ Job_High_Priest +"#" ) ) mes "your party needs a High Priest in your party"; else if ( countstr( .@compare_job$, "#"+ Job_High_Wizard +"#" ) + countstr( .@compare_job$, "#"+ Job_Assassin_Cross +"#" ) + countstr( .@compare_job$, "#"+ Job_Ninja +"#" ) + countstr( .@compare_job$, "#"+ Job_Sniper +"#" ) + countstr( .@compare_job$, "#"+ Job_Lord_Knight +"#" ) < 3 ) mes "your party needs to have at least 3 Damage Dealer classes in your party"; else mes "you are free the go"; close; } Quote Link to comment Share on other sites More sharing options...
Question
Genesis
Hi,
I was wondering if there is a way using
strcharinfo(1)
to determine if a party name has specific character (say "#") in the name. If so, do something.
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.