Page 5 of 5 FirstFirst ... 3 4 5
Results 41 to 45 of 45

Thread: Help with a script

  1. #41

    Default

    I only put that in, because Mafia kept telling me, it couldn't figure out what 'F' was...
    Originally Posted by Pazleysox View Post
    Probably due to some other code change that you haven't bothered to post here (which in general makes it harder for people to help you). The block that you say doesn't work for you works just fine for me.

  2. #42
    Senior Member icon315's Avatar
    Join Date
    Nov 2009
    Location
    Kentucky
    Posts
    674

    Default

    I only put that in, because Mafia kept telling me, it couldn't figure out what 'F' was...

    I figured out what the issue was, aside from the "int f;"
    Originally Posted by Pazleysox View Post
    Maybe you had F instead of f, which are two different variables? Couldn't tell without the actual error.
    I had this in too:
    if (my_inebriety() < inebriety_limit() && my_adventures() > 0)

    while my drunkeness was 14, it was effectively NOT < inebriety_limit()...
    Not sure if this is a question, but it should be <=
    \

  3. #43
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    264

    Default

    Maybe you had F instead of f, which are two different variables? Couldn't tell without the actual error.

    Not sure if this is a question, but it should be <=
    Originally Posted by icon315 View Post
    It's possible. It's working now.
    Last edited by Pazleysox; 08-31-2017 at 12:49 AM.

  4. #44
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    264

    Default

    I don't know if anyone will ever care enough about these forum posts to actually read them, but I will post another silly mistake that I made, and figured out, and fixed on my own. I should say, i've had no formal education in programing, and i'm trying to force my way into learning how to write scripts, so I'm quite pleased with myself when I can find a mistake. Hopefully someone can learn from this.

    Here's the bad code:
    Code:
    		if(get_property("sourceTerminalSpam") < 10 )
    			{
    			float spam = get_property("sourceTerminalSpam")
    			float spammod = (10 - spam);
    				print_html ("You can still install <font color=FF0000>" + spammod + "</font> Source terminal SPAM chip");
    			}
    Here's the fixed code:
    Code:
    		if(get_property("sourceTerminalSpam").to_int() < 10 )
    			{
    			float spam = get_property("sourceTerminalSpam").to_int();	
    			float spammod = (10 - spam);
    				print_html ("You can still install <font color=FF0000>" + (spammod) + "</font> Source terminal SPAM chip");
    			}
    The change is in red. Data Types is a great reference page for learning.

    Final Code:
    Code:
    		if(get_property("sourceTerminalSpam").to_int() < 10 )
    			{
    			int spam = get_property("sourceTerminalSpam").to_int();	
    				print_html ("You can still install <font color=FF0000>" + (10 - spam) + "</font> Source terminal SPAM chip");			}
    Changes again are in red.
    I ended up changing float to int, and putting the math inside the ()
    The only difference in the final output is this:
    You can still install 3.0 Source terminal SPAM chip <-- FLOAT will add the .0

    You can still install 3 Source terminal SPAM chip <-- INT takes away the .0 and leaves a whole number

  5. #45
    Developer
    Join Date
    Aug 2009
    Posts
    2,715

    Default

    while my drunkeness was 14, it was effectively NOT < inebriety_limit()...
    Originally Posted by Pazleysox View Post
    This sounds like a fundamental misunderstanding of what inebriety_limit() returns. That function returns the highest possible drunkenness at which you can still adventure unimpaired. For a new character, this will be 14.

    Note that this is different from KoL's notion of liver space, as demonstrated in Ed.

Posting Permissions

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