Results 1 to 5 of 5

Thread: True/False

  1. #1
    Normal User
    Join Date
    May 2012
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    7
    Rep Power
    0

    True/False

    Hello.

    I want learn more about True/False metod in scripts. Where I can learn ? Any tutorials ?

  2. #2
    Normal User
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,671
    Mentioned
    18 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    8 Post(s)
    Reputation
    132
    Rep Power
    9
    Here's some examples, it's not harder than this.
    Code:
    local SayHi = true
    
    if SayHi then
        say("hi") -- will say hi if true
    end
    Code:
    local SayHi = true
    
    if SayHi == true then
        say("hi") -- will say hi if true
    end

    Code:
    local SayHi = true
    
    if SayHi == false then
        --dont execute any action here unless SayHi = false
    else
        say("hi") -- will say hi if true
    end
    Code:
    local SayHi = true
    
    if not SayHi then
        --dont execute any action here unless SayHi = false
    else
        say("hi") -- will say hi if true
    end
    Last edited by soder; 09-22-2012 at 06:04 PM.

  3. #3
    Normal User RafiXWPT's Avatar
    Join Date
    Jun 2012
    Location
    (Poland) http://rafixwptscripts.com
    Posts
    1,602
    Mentioned
    31 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    128 Post(s)
    Reputation
    128
    Rep Power
    9
    Quote Originally Posted by Xedrox View Post
    Hello.

    I want learn more about True/False metod in scripts. Where I can learn ? Any tutorials ?
    like soder, for example you want to create AutoMount true/false option. Add line in SETUP:
    PHP Code:
    AutoMount true 
    or
    PHP Code:
    AutoMount false 
    .
    Then you can create action named for example: "AutoMount", inside it write:
    PHP Code:
    if AutoMount == true then
    setsettings
    ('Settings\\CaveBot\\Settings\\AutoMount''yes')
    else
    setsettings('Settings\\CaveBot\\Settings\\AutoMount''no')
    end 
    Compleet! You have created AutoMount option in your script.

    Now you can create for example option to hunt hardcore place. Add in your SETUP line:
    PHP Code:
    HardcoreMode true 
    now, in waypoints>action (what will set if player want to hunt hardcore place) add:
    PHP Code:
    if HardcoreMode == true then
    gotolabel
    ("hardcore_yes")
    else
    gotolabel("hardcore_no")
    end 
    (remember to create labels named "hardcore_yes" and "hardcore_no" :P
    thats all, you can add false/true option for everything...

  4. #4
    Normal User
    Join Date
    May 2012
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    7
    Rep Power
    0
    OMG ! Thanks ! Its easy I think. If someone can then add some others HARD example.

  5. #5
    Normal User RafiXWPT's Avatar
    Join Date
    Jun 2012
    Location
    (Poland) http://rafixwptscripts.com
    Posts
    1,602
    Mentioned
    31 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    128 Post(s)
    Reputation
    128
    Rep Power
    9
    hard example? : D okey, here you have option for exori hur / exori ico / exori + playersecurity + monsters to cast exori.
    in setup:
    PHP Code:
    -- -- -- --
    ExoriHur true -- Cast Exori Hur?
    ExoriIco false -- Cast Exori Ico?
    -- -- -- --
    Exori true -- Cast Exori?
    SafeMode false -- Safe Mode?
    -- --
    NeedToUse -- Monsters to use Exori?
    -- -- -- -- 
    and here you have action:

    PHP Code:
    if ExoriHur == true then 
        
    if target.name == ("MONSTER_NAME") and cancast("exori hur"then cast("exori hur")
        
    end
    end 
    if ExoriIco == true then 
        
    if target.name == ("MONSTER_NAME") and cancast("exori ico"then cast("exori ico"
        
    end 
    end 
    if Exori == true then 
        
    if SafeMode == true then 
            
    if paround() == and maround(1"MONSTER_NAME") >= NeedToUse and cancast("exori"then cast("exori")
            
    end 
        
    else
            if 
    maround(1"MONSTER_NAME") >= NeedToUse and cancast("exori"then cast("exori")
            
    end
        end
    end 
    what else... maybe option to minimalize equip.
    in setup:
    PHP Code:
    MinimalizeEquip false 
    action:
    PHP Code:
    local MainBP back
    if MinimalizeEquip == true then
    if windowcount(MainBP) < 1 then
    higherwindows
    ("equip")
    else
    minimizewindows("equip")
    end
    end 
    Last edited by RafiXWPT; 09-22-2012 at 07:57 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
  •