Results 1 to 10 of 70

Thread: Learn how to script with this simple hunting script

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11

    Default

    Quote Originally Posted by Tgo01 View Post
    The indents just make the code a lot easier to read. Like if you're writing an if/else statement then you start the statement with if and end it with end, so you would write it like:

    Code:
    if a != b
    	if a == b
    		echo "Wait, what am I saying?"
    	else
    		echo "no idea"
    	end
    else
    	if b == c
    		echo "Huh?
    	elsif 1 == 2
    		echo "1 can't equal 2!"
    	else
    		echo "Could you repeat that?"
    	end
    end
    This way you can easily see which else/elsif/end belong to which if statements, you can also easily tell which code falls under which if/else statement.

    Likewise the following code would work just as well but if you ever want to edit the code in the future it might be a bit confusing:

    Code:
    if a != b
    if a == b
    echo "Wait, what am I saying?"
    else
    echo "no idea"
    end
    else
    if b == c
    echo "Huh?
    elsif 1 == 2
    echo "1 can't equal 2!"
    else
    echo "Could you repeat that?"
    end
    end


    I'm not sure what you're asking.



    Questions are welcomed and encouraged! How else is one supposed to learn?
    I think he's asking about functions. to which the answer is, yes. They're defined in lich.rbw itself. Look for any lines that begin with "def name_of_some_function_here" or similar. That's where you would find things like where the code for "checkstamina" or "percentmind" (functions you can call in scripts) are.

    http://www.howtogeek.com/howto/progr...method-syntax/
    Last edited by Donquix; 05-25-2015 at 11:12 PM.
    Mithrilschlong, 2015-03-10 to slightly later on 2015-03-10. You will not be forgotten!
    usable Meteor Swarm, late 2020-12-30 to early 2020-12-31. You will also not be forgotten!

Similar Threads

  1. Simple Hunting script
    By Razadine in forum The Lich Project
    Replies: 0
    Last Post: 10-15-2018, 06:40 PM
  2. Simple hunting script that uses ;wander
    By Viekn in forum The Lich Project
    Replies: 4
    Last Post: 05-17-2017, 05:05 AM
  3. learn to script
    By oneillseanm in forum The Lich Project
    Replies: 5
    Last Post: 06-11-2013, 12:16 PM
  4. help with another i'm sure simple script
    By Glaves in forum Miscellaneous Scripts
    Replies: 3
    Last Post: 11-30-2011, 09:02 AM
  5. Sorcerer Rose Illusion teach/learn/speed script
    By Drew2 in forum Scripting Discussion
    Replies: 1
    Last Post: 04-14-2004, 04:46 AM

Posting Permissions

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