Posted: Sat Sep 07, 2002 9:33 pm
I can understand the want for exp info and thats a good idea IMHO but why do you want string manipulation features... what would you use it for?
rk
rk
Need to talk about MacroQuest to other MacroQuest users?
https://mq64.org/phpBB3/
I can think of a number of things I'd use text manipulation for, but only if it were coupled with a $strlen(). The ability to walk a string, for example, could potentially be useful. Also, using strtoupper, strtolower to make sure case is identical when doing string comparisons.rizwank wrote:I can understand the want for exp info and thats a good idea IMHO but why do you want string manipulation features... what would you use it for?
khazil wrote:No offense, Riz, but if you can't think of any uses for string manipulation functions, you haven't done much programming untill recently. :)
I'd use them for situations that require the macro to have very precise knowledge of the information it's given. I can think of several uses, such as parsing through a string sent to it by another macro (through tell, or whatnot). Yes, I know there's the $arg() function, but that doesn't cover everything I'd need.
DeathSpiral wrote:I can think of a number of things I'd use text manipulation for, but only if it were coupled with a $strlen(). The ability to walk a string, for example, could potentially be useful. Also, using strtoupper, strtolower to make sure case is identical when doing string comparisons.
Code: Select all
if(xxx==yyy OR xxx=zzz AND xxx!=aaa){
do this shit
}
elseif(xxx==bbb){
do something else
}
else{
Do yet another thing
}
Code: Select all
for(i=0;i<$something;i++){
the for loop;
}
Code: Select all
#define hp v0
#define mana v1
#define class v2
#define race v3
#define level v4
#define name v5
sub main
/varset hp $char(hp,max)
/varset mana $char(mana,max)
/varset class $char(class)
/varset race $char(race)
/varset level $char(level)
/varset name $char(name)
/echo $name is a level $level $reace $class with $hp hit points and $mana mana.
/returnL124RD wrote:/return[/code[
Code: Select all
/alert clear 1
/alert add basilisk
/alert clear 2
/alert add 2 loc 210,340 radius 90
/target alert 1 noalert 2
Code: Select all
sub main
:Loop
/alert clear 1
/alert add basilisk
/alert clear 2
/alert add 2 loc 210,340 radius 90
/doevents
/target alert 1 noalert 2
/goto :Loop
/return
/sub Event_Alert
/echo Alert $p0 was triggered by Alert line $p1
/return