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
Mindman
Beginner


Joined: 26 Feb 2003
Posts: 14

PostPosted: Wed Jun 04, 2003 7:21 pm   

The script is not working
 
Im using the following script which using the insight command at mobs. This script is reading some attributes that mobs have and add them (if are not exists) on a database but i have to turn anable the whole script and have to go at file/save to make it work .. anyone can help pls?

#CLASS {Insight} {enable}
#ALIAS RecordAdd {
#Var MobDB ""
#if (@MobResistances = "") {MobResistances = "none"}
#if (@MobVulnerabilities = "") {MobVulnerabilities = "none"}
#if (@MobImmunities = "") {MobImmunities = "none"}
#Addkey MobDB Name @MobName
#Addkey MobDB Level @MobLevel
#Addkey MobDB Identical @MobIdentical
#Addkey MobDB Killed @MobKIlled
#Addkey MobDB Alignment @MobAlignment
#Addkey MobDB Resistances @MobResistances
#Addkey MobDB Vulnerabilities @MobVulnerabilities
#Addkey MobDB Procedure @MobProcedure
#Addkey MobDB Immunities @MobImmunities
#Addkey MobDB Room @MobRoom
#Addkey MobDB Area @MobArea
#NEW Name @MobDB
#SHOW "Mob added to database."
#T- Insight
}
#ALIAS db {#T+ Insight %1}
#VAR MobName {a fuzzy gnoll}
#VAR MobArea {Entrance to Hades}
#VAR MobIdentical {4}
#VAR MobKilled {689}
#VAR MobProcedure {}
#VAR MobLevel {208}
#VAR MobAlignment {often kind and thoughtful}
#VAR MobResistances {charm weapon cold}
#VAR Mobvulnerabilities {fire light}
#VAR MobImmunities {summon}
#VAR MobRoom {: Last Level: 0d 0h 17m 26s}
#VAR Test {}
#VAR ObjectExist {}
#TRIGGER {Your insight into} {
#var MobName {} {_nodef} {Insight}
#var MobLevel {} {_nodef} {Insight}
#var MobAlignment {} {_nodef} {Insight}
#var MobVulnerabilities {} {_nodef} {Insight}
#var MobImmunities {} {_nodef} {Insight}
#var MobResistances {} {_nodef} {Insight}
#var MobIdentical {} {_nodef} {Insight}
#var MobKilled {} {_nodef} {Insight}
#var MobProcedure {} {_nodef} {Insight}
#AD pass 1
}
#TRIGGER {*You are in area*:(*)} {MobArea = {%trim( %1)}}
#TRIGGER {*MindMan(*)} {MobRoom = {%trim( %1)}}
#TRIGGER {*Immunities*: (*)} {MobImmunities = {%1}}
#TRIGGER {*Vulnerabilities*: (*)} {MobVulnerabilities = {%1}}
#TRIGGER {*Resistances* : (*)} {MobResistances = {%1}}
#TRIGGER {*a pure and good aura*} {MobAlignment = {a pure and good aura}}
#TRIGGER {*of excellent moral character*} {MobAlignment = {of excellent moral character}}
#TRIGGER {*doesn't have a firm moral commitment*} {MobAlignment = {doesn't have a firm moral commitment}}
#TRIGGER {*just had a bad childhood is all*} {MobAlignment = {just had a bad childhood is all}}
#TRIGGER {*black-hearted murderer*} {MobAlignment = {black-hearted murderer}}
#TRIGGER {*embodyment of pure evil*} {MobAlignment = {embodiment of pure evil}}
#TRIGGER {*embodiment of pure evil*} {MobAlignment = {embodiment of pure evil}}
#TRIGGER {*often kind and thoughtful*} {MobAlignment = {often kind and thoughtful}}
#TRIGGER {*Mob Base Level*:(*)} {MobLevel = %1}
#TRIGGER {*Identical Mobs*: (*)} {MobIdentical = %1}
#TRIGGER {*Times Killed*: (*)} {MobKilled = %1}
#TRIGGER {a * has a special procedure of some sort} {MobProcedure = Y}
#TRIGGER {*Mob Short Name*: (*)} {MobName = %1}
#TRIGGER {*You are charged} {
#DBFIRST
ObjectExist = ""
#WHILE (!%null( %rec)) {
#IF (@MobName=&Name and @MobArea=&Area and @MobAlignment=&Alignment) {ObjectExist = 1}
#DBNEXT
}
#IF (@ObjectExist != "1") {RecordAdd} {#T- Insight}
#if (@objectExist = "1") {#show "Already Logged"}{#T- Insight}
}
#TRIGGER {Your insight appears blurred and (*)} {#T- Insight}
#TRIGGER {That mob is too high level to insight!} {#T- Insight}
#CLASS 0
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Jun 05, 2003 8:16 am   
 
How is it not working?

I don't really feel like wading through 75 lines of script to figure out what you're trying to do and where you went wrong. Probably nobody else does either, which is why you haven't gotten any responses.

You stand a much better chance of getting help by clearly explaining what you thought the script would do and how it's not working (what it's doing that's different from what you expected).

Here's what I understand so far:
1. This script is intended to run when you use the "insight" command.
2. It's supposed to get information from the output of that command for entry into a database.
3. It doesn't work, or at least not the way you want it to.

LightBulb
Advanced Member
Reply with quote
DeathofOne
Beginner


Joined: 03 Jun 2003
Posts: 25

PostPosted: Thu Jun 05, 2003 4:07 pm   
 
Like person said above me but I see one problem with your triggers

( and ) are not put into the check of a trigger withour ~. So ~(*~)
Reply with quote
Lalaynya
Wanderer


Joined: 23 Aug 2002
Posts: 96

PostPosted: Thu Jun 05, 2003 4:54 pm   
 
quote:

Like person said above me but I see one problem with your triggers

( and ) are not put into the check of a trigger withour ~. So ~(*~)





Looks like the ( )'s are for capturing info, not trigger matching, so it would be correct the way it is....
Reply with quote
Mindman
Beginner


Joined: 26 Feb 2003
Posts: 14

PostPosted: Thu Jun 05, 2003 7:30 pm   
 

Here's what I understand so far:
1. This script is intended to run when you use the "insight" command.
2. It's supposed to get information from the output of that command for entry into a database.
3. It doesn't work, or at least not the way you want it to.


Yes ..it supposed to do that excactly but is not working with that way. The strange is that to get the whole script working i have to turn the whole class enabe (from classes button) and then i have to go at file/save and save it to make it run. Another strange thing is that i dont have any error messages .. and the guy who gave it to me he said that the whole script is working perfectly ..
I really dont expect someone to spend his time to read the whole script line by line but i post it excactly as is only for the case that someone wants to experiment with this ..
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Jun 05, 2003 8:43 pm   
 
I think you're missing an #ALIAS, one which would be OUTSIDE the Insight Class. It should enable the class, then do the insight command, something like this:
#AL insight {#T+ Insight;~insight}

You might prefer to have a #TRIGGER enable the class when it detects the beginning of the "insight" info. If so, it would need to be OUTSIDE the class.

LightBulb
Advanced Member
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