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
Shinos
Newbie


Joined: 20 Feb 2005
Posts: 4

PostPosted: Tue Mar 01, 2005 12:52 am   

Someone sent me this for Dragonrealms..needs HELP
 
If someone wouldn't mind kinda lookin through this and tell me why it isn't workin... ah still don't know much about (what) I'm doin.. but I'm trying

This class will alternate between weapons while hunting. You will need a gsl trigger that tracks the contents of your left and right hands in order for this to work.

#CLASS {MissleWeaponHuntingScript}
#ALIAS CollectAmmo {
#WAIT 2000
#FORALL @RoomContents {#IF (%ismember( %i, @AmmoTypes)) {
get %i
#WAIT
open my back
#WAIT 1000
put my %i in my back
#WAIT 1000
close my back
#WAIT
}}
look
#WAIT 1000
open back
#WAIT 1000
load
}
#ALIAS FindHardestCritter {
#VAR HighestCritterPos 0
#VAR HighestCritterName "none"
look
#WAIT 2000
#FORALL @RoomContents {#IF (%iskey( @Critters, %i)) {#IF (%db( @Critters, %i) > @HighestCritterPos) {
#VAR HighestCritterPos %db( @Critters, %i)
#VAR HighestCritterName %i
}}}
#IF (@HighestCritterName == "none") {
Print Could not find critter in list
aim
} {
Print Found @HighestCritterName
#IF (@NoAim) {fire @HighestCritterName left eye} {aim @HighestCritterName}
}
}
#ALIAS GetRandomWeapon {
#VAR CurrentWeapon %item( @MissleWeaponTypes, %random( %numitems( @MissleWeaponTypes)))
#VAR CurrentAmmo %db( @AmmoList, @CurrentWeapon)
#IF (!@CurrentWeapon) {GetRandomWeapon}
Print Weapon: @CurrentWeapon
Print Ammo: @CurrentAmmo
}
#VAR CurrentWeapon {sling}
#VAR IsFighting {0} {0}
#VAR AmmoTypes {rock|arrow}
#VAR HighestCritterPos {5} {0}
#VAR HighestCritterName {madman}
#VAR NoAim {1} {0}
#VAR AmmoList {c bowarrows bowarrows slingrockslingrock}
#VAR CurrentAmmo {rock}
#VAR MissleWeaponTypes {c bow|s sling|sling|s bow}
#TRIGGER {^Your * isn't loaded!} {load}
#TRIGGER {^Roundtime:*(%d) sec.} {
#WAIT 5000
findhardestcritter
}
#TRIGGER {^~[Roundtime (%d) sec.~]} {
#WAIT 6000
findhardestcritter
}
#TRIGGER {^{A|An} * begins to advance on you!} {#IF (!@IsFighting) {
GetRandomWeapon
#VAR IsFighting 1
#IF (@RightHandContents != @CurrentWeapon) {
get @CurrentWeapon
}
findhardestcritter
}}
#TRIGGER {^At what are you trying to fire?} {
collectammo
findhardestcritter
}
#TRIGGER {^That is already loaded with {a|an}*!} {findhardestcritter}
#TRIGGER {^You dont have the right ammunition for your *} {collectammo}
#TRIGGER {^There is nothing else to face!} {
collectammo
unload
#WAIT 2000
put @CurrentWeapon in back
clearhands
#VAR IsFighting 0
}
#TRIGGER {^You think you have your best shot possible now.} {fire}
#TRIGGER {As you try to reach into your old backpack for some arrows, your hand jams into its closed cover.} {
open back
#WAIT
load
}
#TRIGGER {*{a|an} * (%w) which appears dead*} {
search %1
collectammo
}
#TRIGGER {^You need both hands in order to aim.} {
open my back
#WAIT
put @LeftHandContents in back
#WAIT
findhardestcritter
}
#TRIGGER {^You are too closely engaged and will have to retreat first.} {aim}
#TRIGGER {^You can not locate the target.} {}
#TRIGGER {^You must have both hands free to use} {
drop @LeftHandContents
#WAIT
fire @HighestCritterName left eye
}
#TRIGGER {^But your * isn't loaded!} {load}
#CLASS 0
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