Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Atreides_096
Wanderer


Joined: 21 Jan 2005
Posts: 99
Location: Solvang, CA

PostPosted: Sat Sep 17, 2005 6:49 am   

Need help.. from scratch :P
 
Ok, I was going to attempt to do something today I'd never done before. Looked at some pieces of code that did something similar, and figured I'd come here to help fix bugs... however, I'm 100% lost on this, don't even know where to start :P So if anyone is interested in the "challenge" of coding something for me (prolly won't be much of a challenge to most)...

I'm lookin to create several aliases to create popup windows. The window would be of the click to highlight variety, and would list a series of options. After hitting "ok", it should output all options that were highlighted in one string. There will be 4 sets of options for 4 windows (4 aliases). The first set is:

Code:
blind|invisible|detect_evil|detect_invis|detect_magic|detect_hidden|
detect_good|sanctuary|faerie_fire|infrared|curse|lightspeed|poison|
protect_evil|protect_good|sneak|hide|sleep|charm|flying|pass_door|
haste|calm|plague|underwater breath|dark_vision|berserk|swim|
regeneration|slow|web

The second is:
Code:
area_attack|bash|berserk|disarm|rescue|dodge|fast|kick|dirt_kick|
parry|trip|assist_all|assist_align|assist_race|assist_players|assist_guard|
assist_vnum

The third is:
Code:
Slice|Stab|Slash|Whip|Claw|Blast|Pound|Crush|Grep|Bite|Pierce|Suction|
Beating|Digestion|Charge|Slap|Punch|Wrath|DivinePower|Cleave|
Scratch|Peck|Chop|Sting|Smash|ShockingBite|FlamingBite|FreezingBite|
AcidicBite|Chomp|Drain|Thrust|Slime|Shock|Thwack|Flame|Chill|
MentalEnergy|MindForce|DecayingTouch|Friction|Earth|Air|Magic|Shadow|
WaterBlast|Wail

The fourth is:
Code:
magic|bash|pierce|slash|fire|cold|lightning|acid|poison|negative|holy|
energy|mental|disease|water|light|sonic|earth|air|shadow


The output would be (for first) "aff <string>" . for second "off <string>". for third "damtype <string>", and for fourth "imm <string>"

For example, "aff invisible sneak flying" or "off rescue parry dodge"

This is (obviously) a set of aliases to assist in building in OLC, BTW ;)

Couple of modifiers:

* Would like it if in the first (Aff) list, the following were highlighted by default:
detect_evil detect_invis detect_magic detect_hidden detect_good infrared

* If possible, some #if statements. In the AFF alias:
if @moblevel is between 50 and 99, highlight haste by default.
if @moblevel is 100+, highlight haste and lightspeed by default.

In the OFF alias:
if @moblevel is between 50 and 99, highlight dodge by default
if @moblevel is 100+, highlight dodge and parry by default
--------------------
I am really not sure how big of a request this is. For me, it's virtually impossible :P If someone thinks they can throw this together in 10 mins, and would be so kind as to do so, it would be greatly appreciated. If it turns into a major chore, I can of course live without it :) Thanks a lot in advance, if anyone chooses to help :)

Note: I can probably do the aliases for "damtype" and "imm" myself, once given a structure to base it off of from the other 2 aliases... *probably*... but I figured I'd throw in my entire goal since... well I'm a leech? ;) Nah just assume that if someone actually chooses to help me here, they can probably do those 2 aliases in a matter of minutes after creating the first (harder) set. Anyway, thanks again if someone chooses to create any/all of these... I was 100% lost when I tried :P (even with some examples of similar code)
Reply with quote
billaben
Wanderer


Joined: 02 Sep 2005
Posts: 60

PostPosted: Wed Sep 21, 2005 6:09 pm   
 
Don't want much do ya?

As far as I know, zMUD does not do popup windows Period. To say nothing of popup windows of the highlight variety. Also setting this up so it only highlights certain traits for certain mobs is unrealistic. In order to even attempt such a solution you would first have to Assume that all mob names are unique and secondly build a database for all of those mobs with individual settings for each mob. Too much damn work. =P

Are these traits someting that show up all the time? or only when you (look at/inspect/consider/whatever) the monster? Some example text of what you're trying to filter this massive list of words from would be helpful.

This block of code MIGHT decide to color every occurance of any of thse words from the Mud. Then again it might just decide to torture you dog instead. One never knows.

Code:
#CLASS {System}
#VAR Traits {blind|invisible|detect_evil|detect_invis|detect_magic|detect_hidden|detect_good|sanctuary|faerie_fire|infrared|curse|lightspeed|poison|protect_evil|protect_good|sneak|hide|sleep|charm|flying|pass_door|haste|calm|plague|underwater breath|dark_vision|berserk|swim|regeneration|slow|web}
#TRIGGER {@Traits} {#CW "#FF8080"}
#CLASS 0
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Sep 22, 2005 12:07 am   
 
Take a look at the help for %pick. It allows multiple selections and seems to be what you are looking for. Since its return is in a zScript list format you will also need to use %replace or %expandlist. Quick example:

#VARIABLE Affects {p:Please choose affects|blind|invisible|detect_evil|detect_invis|detect_magic|detect_hidden|detect_good|sanctuary|faerie_fire|infrared|curse|lightspeed|poison|protect_evil|protect_good|sneak|hide|sleep|charm|flying|pass_door|haste|calm|plague|underwater breath|dark_vision|berserk|swim|regeneration|slow|web}
#VARIABLE Offenses {p:Please choose offense methods|area_attack|bash|berserk|disarm|rescue|dodge|fast|kick|dirt_kick|parry|trip|assist_all|assist_align|assist_race|assist_players|assist_guard|assist_vnum}
#ALIAS examplename {aff %expandlist(%pick(@Affects)," ");off %replace(%pick(@Offenses),"|"," ")}
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Atreides_096
Wanderer


Joined: 21 Jan 2005
Posts: 99
Location: Solvang, CA

PostPosted: Thu Sep 22, 2005 1:40 am   
 
Billaben: I think you misunderstood the request. And tho it did sound like
a lot, once I saw what I needed to do, it's actually a very simple system.
I made the request based on something I had seen in another script, but
the system was MUCH more complex in that script, and I couldn't figure it
out. But it really takes me longer to create the variables needed than the
alias now (I actually had about 20 of those aliases I wanted to make, I
picked 4 to post here, each alias now takes about 5 secs :P )

Vijilante: Yes, %pick was *exactly* what I needed :P I had actually
received private help on this matter yesterday, and the setup I learned is
slightly easier, tho basically the same thing :)
Code:
#va OLCDtVar {hit|slice|stab|slash|whip|claw|blast|pound|crush|grep|bite|pierce|suction}
#al {dtset} {#var OLClist {@OLCDTVar};#FORALL %pick( "p:Select mob's Damtype", "o:1", @OLCList) {damtype '%i'}}


For the affset and offset pre-highlights, it was use of %replaceitem to add an * in front of the object, then reset the variable after use. Such as:
Code:
#va OLCList %replaceitem( *detect_evil, %ismember( detect_evil, @OLCList), @OLCList)

determined by simple #if statements. Anyway, thanks a lot for the help guys!
Reply with quote
billaben
Wanderer


Joined: 02 Sep 2005
Posts: 60

PostPosted: Thu Sep 22, 2005 3:59 am   
 
Humm... Well I guess I'm confused then. Still confused in fact. But If you're making progress on your idea now, that's what really matters. =P
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net