 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Feb 09, 2007 3:48 am
[1.24]ERROR: argument still on stack |
This is the code of a simple trigger I'm working on. It is part of a larger fishing script for Dragonrealms MUD.
Quote: |
#if ($FishType = "seaweed") {
drop seaweed
} {
#additem Fish $FishType
throw my %word($FishType,%numwords($FishType))
#if (%numitems(@FishingSpots.%gsl(p))) {
#say testing second if true code
#if (!%pos($FishType,%db(@FishingSpots,%gsl(p)))) {
#say testing third if true code
FishingSpots.%gsl(p) = %concat(@FishingSpots.%gsl(p),~|,$FishType)
}
} {
#say testing second if false code
FishingSpots.%gsl(p) = $FishType
}
}
bait.onPole = "none"
|
This is what happens if $FishType (in the below case, that would be the muskalundge) does not already appear in the stringlist. Every other aspect about this trigger and the larger fishing script works without error or weird early-version CMud quirk. Despite the below, everything about the trigger continues to work though I'm left with a data record variable key that ends up not getting updated.
Quote: |
throw my muskalundge
testing second if true code
testing third if true code
ERROR: argument still on stack: FishingSpots.Fisherman's Corner, Este Lane = flat-eyed creppoo|blue muskalundge
ERROR: argument still on stack: FishingSpots.Fisherman's Corner, Este Lane = flat-eyed creppoo|blue muskalundge
ERROR: argument still on stack: FishingSpots.Fisherman's Corner, Este Lane = flat-eyed creppoo|blue muskalundge
FishingSpots.Fisherman's Corner, Este Lane = flat-eyed creppoo|blue muskalundge
|
Anyone have any insights on how I might fix this, aside from being an actual bug or having to clutter up the code with lots of %replace() functions and the like? |
|
_________________ EDIT: I didn't like my old signature |
|
|
 |
Larkin Wizard

Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Fri Feb 09, 2007 7:33 pm |
It looks to me like the problem is caused by using FishingSpots.%gsl(p) when the result from %gsl(p) is not a simple one word value. Try replacing that line with something like this:
Code: |
#ADDKEY FishingSpots {%gsl(p)} {%concat(%db(@FishingSpots, %gsl(p)), "|", $FishType)} |
(Same thing for the other lines with FishingSpots.%gsl(p) in them...) |
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Feb 09, 2007 10:36 pm |
Ok, that was annoying. I did the exact same thing last night and it wasn't working at all, so I assume it was just an issue of having to restart CMud. Any plans for a troubleshooter wizard to go along with the syntax checker, Zugg?
|
|
_________________ EDIT: I didn't like my old signature |
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Sat Feb 10, 2007 12:02 am |
Yeah, I was working on something that was going to make me rich and famous called the "Automatic Bug Fix Wizard". The idea was for a wizard that automatically analyzed any software (CMUD scripts included) and would find each bug in the code and provide a recommended fix for it. However, I eventually realized that the algorithm for this wizard was quite complex and had a lot of issues. I tried to develop it using itself. I thought that if I wrote a basic alpha version, I could then run the Bug Fix wizard on itself to find and fix the remaining bugs to get it working. But this didn't seem to work very well. I eventually gave up on the idea and realized that I was just dreaming and needed to wake up and get out of bed 
|
|
|
 |
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Sat Feb 10, 2007 1:15 am |
Eep! Isn't that how Skynet started - we'll have Terminators running around all over the place if the machines get too smart.
<dons tin foil hat> |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
 |
|
|