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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
groundzero2010
Novice


Joined: 30 Sep 2004
Posts: 47
Location: Arkansas

PostPosted: Sun Dec 30, 2007 9:10 pm   

Compatability logs
 
I was just curious if anyone could help me figure out what is wrong with these errors.

Code:

Trigger Your knowledge of &n increases!
   Does not compile : illegal token: = @last11 at row 0 col 257

Trigger You need to visit a master to learn more about &n!
   Does not compile : illegal token: = @master10 at row 0 col 273

Trigger ^(%w) (%w) (%w)%sSpell Level: (%d)%sLevel:%s(%d)
   [] immediate evaluation syntax no longer used [Help] : [%1%2%3]

Trigger ^(%w) (%w)%sSpell Level: (%d)%sLevel:%s(%d)
   [] immediate evaluation syntax no longer used [Help] : [%1%2]

Trigger ^(%w)%sSpell Level: (%d)%sLevel:%s(%d)
   [] immediate evaluation syntax no longer used [Help] : [%1]

Trigger Your knowledge of (*) increases!
   Does not compile : illegal token: = @last11 at row 0 col 214

Trigger You need to visit a master to learn more about (*)!
   Does not compile : illegal token: = @master11 at row 0 col 264

Trigger {You don't have enough mana to mix that potion!|You haven't the
   Does not compile : illegal token: at row 0 col 110

Trigger Item is: (%*)
   %1 within quotes is not expanded [Help] : #addkey item itemis %replace( "%1"

Trigger Item can be worn(%*)
   %1 within quotes is not expanded [Help] : #var wear {%replace( "%1"

Trigger Item will give you following abilities: (%*)
   %1 within quotes is not expanded [Help] : #var abi {%replace( "%1"

Trigger Race/Class Restrict:(%*)
   %1 within quotes is not expanded [Help] : #addkey item restrict {%replace( "%1"

Trigger Makes (immune) to (%*)
   %1 within quotes is not expanded [Help] : #var res {%replace( "%2"

Trigger Makes (resistant) to (%*)
   %1 within quotes is not expanded [Help] : #var res {%replace( "%2"

Trigger Makes (susceptable) to (%*)
   %1 within quotes is not expanded [Help] : #var res {%replace( "%2"
Reply with quote
iljhar
GURU


Joined: 10 Oct 2000
Posts: 1116
Location: USA

PostPosted: Mon Dec 31, 2007 3:22 am   
 
I think if you post the actual triggers, we'd be able to help you out a little more.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Dec 31, 2007 3:32 am   
 
Click the links to be taken to the relevant sections of the help. The online versions of those articles are here and here.

Illegal token is a catch-all error, so it's hard to diagnose without the actual script. At a guess, you're using = when you shouldn't, but that's as specific as I can be.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
groundzero2010
Novice


Joined: 30 Sep 2004
Posts: 47
Location: Arkansas

PostPosted: Mon Dec 31, 2007 1:57 pm   Here are just a couple of the errors and the code that they point to.
 
Alias store_id
Code:
;#DBLOAD eq;#IF !%null( %find( @item.Name, All, Name)) {#dbget %find( @item.Name, All, Name);#sa %rec;#YESNO "A duplicate item already exists, stop?" {#abort 1} {Keep:#say Adding}};#PROMPT item.mob "Mob Name?";#PROMPT item.zone "Zone where found?";#PROMPT item.notes "Do you have any notes?";#addkey item modify @modify;#new All @item;;#dbreset;;#dbsave eq

Does not compile : illegal token: } at row 0 col 357


Trigger Your knowledge of &n increases!
Code:
#add nex 1;#ec %1 gained knowledge starting %item( @spellList, @nex);@last12 = @last11;@last11 = @last10;@last10 = @last9;@last9 = @last8;@last8 = @last7;@last7 = @last6;@last6 = @last5;@last5 = @last4;@last4 = @last3;@last3 = @last2;@last2 = @last1;@last1 = %1

Does not compile : illegal token: = @last11 at row 0 col 257

Trigger ^(%w)%sSpell Level: (%d)%sLevel:%s(%d)
Code:
#var spell [%1];#addkey @spell splev %2;#addkey @spell levrec %3;#addkey @spell maxsplev {%if( (@char.level-%3+2)>10, 10, %eval( @char.level-%3+2))};#addkey @spell diff {%eval( @{@{spell}.maxsplev}- @{@{spell}.splev})};#if @{@{spell}.diff} {#sa ToGain: @{@{spell}.diff};#additem spelllist @spell;#sa Added @spell to spelllist}

[] immediate evaluation syntax no longer used [Help] : [%1]

Trigger Item is: (%*)
Code:
#addkey item itemis %replace( "%1", " ", ",");#CW "#FF8040"

%1 within quotes is not expanded [Help] : #addkey item itemis %replace( "%1"

[/code]
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Mon Dec 31, 2007 2:22 pm   
 
Try the following

Code:
#ALIAS store_id {#DBLOAD eq
#IF !%null( %find( @item.Name, All, Name)) {
  #dbget %find( @item.Name, All, Name)
  #sa %rec
  #YESNO "A duplicate item already exists, stop?" {#abort 1} {Keep:#say Adding}
  }
#PROMPT item.mob "Mob Name?"
#PROMPT item.zone "Zone where found?"
#PROMPT item.notes "Do you have any notes?"
#addkey item modify @modify
#new All @item
#dbreset
#dbsave eq
}


Code:
#TR {Your knowledge of &n increases!} {#add nex 1
#ec %1 gained knowledge starting %item( @spellList, @nex)
last12 = @last11
last11 = @last10
last10 = @last9
last9 = @last8
last8 = @last7
last7 = @last6
last6 = @last5
last5 = @last4
last4 = @last3
last3 = @last2
last2 = @last1
last1 = %1
}
The problem was that you were assigning variables using the old, incorrect, syntax that zMUD was lazy enough to allow
Instead of using @var = value
You should be using var = value

Code:
#TR {^(%w)%sSpell Level: (%d)%sLevel:%s(%d)} {#var spell %1
#addkey spell splev %2
#addkey spell levrec %3
#addkey spell maxsplev {%if( (@char.level-%3+2)>10, 10, %eval( @char.level-%3+2))}
#addkey spell diff {%eval( @{@{spell}.maxsplev}- @{@{spell}.splev})}
#if @{@{spell}.diff} {
  #sa ToGain: @{@{spell}.diff}
  #additem spelllist @spell
  #sa Added @spell to spelllist
  }
}


Code:
#TR {(%*)} {#addkey item itemis %replace( %1, " ", ",")
#CW "#FF8040"}
You don't need to put %1 in quotes anymore.
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Dec 31, 2007 4:51 pm   
 
Read the help I linked to for information on the "%1" thing.

Your first script has extra semicolons - one at the start, and some of the other semicolons are doubled. If you mean to quote those lines, you might find it better to use // comments on their own line.

Guinn's explained the var=value thing, too.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
groundzero2010
Novice


Joined: 30 Sep 2004
Posts: 47
Location: Arkansas

PostPosted: Mon Dec 31, 2007 7:18 pm   
 
Quote:
Guinn wrote this:
Code:
#TR {^(%w)%sSpell Level: (%d)%sLevel:%s(%d)} {#var spell %1
#addkey spell splev %2
#addkey spell levrec %3
#addkey spell maxsplev {%if( (@char.level-%3+2)>10, 10, %eval( @char.level-%3+2))}
#addkey spell diff {%eval( @{@{spell}.maxsplev}- @{@{spell}.splev})}
#if @{@{spell}.diff} {
  #sa ToGain: @{@{spell}.diff}
  #additem spelllist @spell
  #sa Added @spell to spelllist
  }
}




All I changed on this was took the [ ] out of
Code:
#var spell [%1]

which now looks like
Code:
#var spell %1

I left the rest of that script the same. It passed through the compatability test. Should I go through and remove the @ symbols like suggested?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Tue Jan 01, 2008 10:53 pm   
 
No. You only need to remove the @ symbols when assigning variables, not when calling their values.

#say Added @spell to spelllist
will need to stay the same, but
@spell = "heal"
would need to change.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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