Page 2 of 5

Posted: Sat Sep 07, 2002 9:33 pm
by rizwank
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

Posted: Sun Sep 08, 2002 12:34 am
by DeathSpiral
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?
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.

Posted: Sun Sep 08, 2002 12:54 am
by L124RD
Salutations,
MQ isn't case sensitive to begin with... except events i think...

Posted: Sun Sep 08, 2002 3:06 am
by rizwank
OMG LOGO!

WALK 100
RT 90

Posted: Sun Sep 08, 2002 12:14 pm
by khazil
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.

As for Case Sensitivity, well, strings passed to arrays all end up lowercase, and ~~ doesn't seem to be case insensitive. For my macro, I had a list of names of people who could interact with it. When a tell or group invite was sent, the macro should have checked the names and given the correct people access. Instead, no one was able to use it. I tried everything, but eventually I had to go with using and authentication /tell to make sure unauthorized people don't have access. Highly annoying.

I don't mind that /if is case sensitive. I do mind the fact that I can't do anything about the strings in my variables, and the fact that arrays like to set everything to lowercase, regardless of how they went in.

Besides, if the functionality is there, people will use it, whether the original designers saw a use for it or not. It'll make coding that much easier.

Posted: Sun Sep 08, 2002 12:58 pm
by rizwank
Slight offense taken, but ill shrug it off.

String manipulation is important, it was a question of its usefulness here... Someone said to "walk a string" and that is a good idea there... Im currently thinking in terms of the macros we have so far; and I cant see how many of them would benefit from these; however, if it is there, it will be used :)
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.

Posted: Sun Sep 08, 2002 6:52 pm
by Valerian
no, someone said "walk a string" which is immensely different than "walk a path".
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.

Posted: Wed Sep 11, 2002 12:41 pm
by khazil
No one said anything about walking a path...

Either way, how bout it, coders? String manipulation functions?

Posted: Wed Sep 11, 2002 12:48 pm
by rizwank
I edited my post from walk a path to walk a string ;p

I dunno, this is a Plaz question... I think there is a place to put it in the sourceforge thing too..

Posted: Wed Sep 11, 2002 5:08 pm
by Coraz
I'd like a little help learning what all of the confusing#var=$~~! /sub blap stuff means! :shock:

I feel so dumb :oops:

Posted: Wed Sep 11, 2002 8:21 pm
by Amadeus
I would like to request a modification to /tell that would allow you to abbreviate names. This would only work within the current zone.

For example, I would love to be able to send a tell to Baowolfe by just typing /tell bao hey!!

...Maybe it's not possible, but it's a request all the same :)

Custom variable names

Posted: Wed Sep 11, 2002 8:22 pm
by Digitalxero
Custom var names
Currently you can only have v# p# a# l# ect as var
names, what I would like is to be able to have custom
var names

/varset string Textvar "This is a string variable"

/echo $Textvar

[MacroQuest]This is a string variable

Others I would like to see

/varset array arrayvar [one,two,three,four,testing,ect]

/echo $arrayvar[0]

[MacroQuest]one

/varset array arrayvarone[one=>1,hp=>$target
(hp,pct),ect=>other stuff]

/echo $arrayvarone[one]
/echo $arrayvarone[hp]
[MacroQuest]1
[MacroQuest]35

/varset int intagervar 15
/varset loc locvar ###.##,###.##,###.##
/varset sloc Locname sx,sy

sx and sy = screen xy cords


Might think of others after those are added and I play
with them a bit.

Custom var names just could not have the same name
as one of your static ones, this would make the macro's
alot easyer to read also, and you wont have namespace
spillover if people start combining several macros. Also
currently there is only support for v0 - v100 This should
be increased to atleast 1000 or 10,000 untill you can
add customvar names. That way people can pick a
range of 100 vars they wana work with.


You also might consider adding ; as the end of
command determiner so that formating becomes easyer
once you add custom var names, and such

ie. /varset array Arrayvar [
HP=>$target(hp,cur),
MANA=>$char(mana,cur),
ECT=>more stuff];

That way it can spreat to multi lines easyer.

Wouldnt mind if you added a new command also

@<Variable Name> = <text string,array(array options),
#, Loc,screen)

##Example of declaring an array
@Arrayvar = array(
HP=>$target(hp,cur),
Mana=>$char(mana,cur),
ECT=>other shit);


##String
@Stringvar = "This is a string variable";
OR
@Stringvar = "$target(name)";

##Int
@Intvar = 7;

##Loc
@Locvar = 75.23,189.01,30.5;

##Screen
@Screencord = 50,100;


Also I think if you get rid of a few of the / commands
such as /if it may speed up the parsing a bit since it
knows it isnt an EQ command it wont try and parse it as
such

mouseto
if
for
sendkey
press
click
echo
goto
call
doevents
return

All of those should be removed from the slash command
list and just made keywords. I would keep the / versions
in the for backward compatability but make them
deprciated and have MacroQuest spit a warning when it
loads a macro with the old version saying that these are
depreciated and will be removed in future release ect.

if should be changed to support and add elseif

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 
} 
for should also support this format

Code: Select all

for(i=0;i<$something;i++){ 
the for loop; 
} 

Posted: Wed Sep 11, 2002 9:18 pm
by L124RD
Salutations,
custom var names... dum dum dum...
[[Apparently l124rd can't read write code brackets... /boggle l124rd]]

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.
/return

Posted: Wed Sep 11, 2002 9:42 pm
by Valerian
and I thought L124RD liked code brackets... *chuckles*
L124RD wrote:/return[/code[

Posted: Thu Sep 12, 2002 5:54 am
by Fippy
I would like to see a filter for alerts so I can specify a loc and a radius so i could do something like

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

What this would do is avoid targeting basilisks that are within the radius of the specified loc. That way you can avoid an inappropriate bath in a lava pool.

What would also be cool would be Events based on the alert list so to continue the example above

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
this would echo to the screen something like

Alert 1 was triggered by Alert Line a, basilisk
Alert 1 was triggered by Alert Line a, basilisk
Alert 1 was triggered by Alert Line a, basilisk
Alert 2 was triggered by loc 210,340 radius 90
Alert 1 was triggered by Alert Line a, basilisk