Results 1 to 4 of 4

Thread: Scritp verification error less than helpful unless creating debug log

  1. #1
    Senior Member Winterbay's Avatar
    Join Date
    Feb 2010
    Posts
    5,033

    Default Scritp verification error less than helpful unless creating debug log

    Sometimes I do stupid things when I write ash-scripts. Generally it is trying to compare two variables that are not the same type (stat versus int for example when I forget that my_primestat() returns a stat and not the value of said stat). In this case the verification prints out "Cannot apply operator " which doesn't really help. Starting a debug-log, verifying and stopping the log gives the following text in the debug log:
    Code:
    Cannot apply operator < to safeMox() (int) and my_primestat() (stat) (test.ash, line 17)
    Which is slightly more helpful. Could the printout in the CLI be the same as for the debuglog? Or is my setup somehow screwed up and this is working for everyone else?

    The code I used to create the error in this case were:
    Code:
    //Returns the safe Moxie for given location, by going through all the monsters in it.
    int safeMox(location loc) {
    	//Softcore is deemed to be able to take care of virtually any ML. 
    	if (loc == $location[primordial soup] || !in_hardcore() || get_property("bcasc_ignoreSafeMoxInHardcore") == "true") return 0;
    	int ret = 0;
    	
    	//Find the hardest monster. 
    	foreach mob, freq in appearance_rates(loc) {
    		if (freq >= 0 && mob != $monster[Guy Made of Bees]) ret = max(ret, monster_attack(mob));
    	}
    	//Note that monster_attack() takes into account ML. So just add something to account for this.
    	return ret + 4;
    }
    
    location best = $location[none];
    foreach loc in $locations[] {
    	if(safeMox(loc) < my_primestat() && safeMox(loc) > safeMox(best)) best = loc;
    }
    print("The best place to level in is " + loc);
    My scripts:
    Best sushi for Profit
    Winterbay's Helpful Automatic Monsterbasher (WHAM)

    Scripts maintained by me:
    Autobasement
    Smashlib

    A small programmer joke:
    Wife: Honey, please go to the market and buy 1 bottle of milk. If they have eggs, bring 6.
    The man came back with 6 bottles of milk.
    Wife: Why did you buy 6 bottles of milk.
    Man: Because they had eggs...

    The 6 Stages of Debugging: 1 )That can't happen. 2) That shouldn't happen. 3) Hmmm, weird. 4) Why does that happen? 5) Oh, I see. 6 )How did that ever work?

    All programs can be optimized, and all programs have bugs; therefore all programs can be optimized to one line that doesn’t work. /Bob Fitch, Blizzard

  2. #2

    Default

    I'm getting the same thing... However, flip that comparison sign around, and I get:
    Code:
    Cannot apply operator > to safeMox() (int) and my_primestat() (stat) (deleteWBtest.ash, line 17)
    Leads me to wonder if there's an accidentally-parsing-as-HTML-tag-opening issue...
    Before you ask, please check the FAQ.
    Veracity: My "humble opinion" trumps your "humble opinion". IMHO.

  3. #3
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    10,664

    Default

    Yes. This is an issue with how it is shown in the gCLI, not what error message we generate.
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  4. #4
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    10,664

    Default

    Revision 10830
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

Similar Threads

  1. Bug Creating Talisman o' Nam results in an error
    By dangerpin in forum Bug Reports
    Replies: 65
    Last Post: 03-05-2014, 04:49 PM
  2. Bug - Fixed Unexpected error, debug log printed. CHIT: Error Parsing Refresh
    By Khari in forum Bug Reports
    Replies: 5
    Last Post: 01-25-2014, 12:51 AM
  3. Bug - Fixed session_logs(-1) causes debug error
    By Crowther in forum Bug Reports
    Replies: 3
    Last Post: 08-07-2013, 09:34 PM
  4. Bug - Fixed r12063 - Random? Debug error
    By Fluxxdog in forum Bug Reports
    Replies: 3
    Last Post: 05-03-2013, 01:45 PM
  5. Bug - Fixed Debug Error r12067
    By Captain Kirk in forum Bug Reports
    Replies: 2
    Last Post: 05-02-2013, 10:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •