Results 1 to 2 of 2

Thread: Settings System Problem

  1. #1
    iBot User
    Join Date
    Sep 2013
    Posts
    38
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    7 Post(s)
    Reputation
    24
    Rep Power
    4

    Settings System Problem

    Hello I just making a script and probably will need a little help with few things.


    Action 1
    Code:
    if Voc == Ed then
        setsettings("Settings\\Healer\\Rules\\Exura Vita\\Enabled", "yes") 
    
        setsettings("Settings\\Healer\\Rules\\Exura San\\Enabled", "no") 
    end
    In Setup i got
    Code:
    --Global Settings--
        Voc = "Ed" --(Ms,Ed,Rp)
    But bot dont change the settings. Like a bot don`t recognise the Variable called Voc... If i put setsettings only (without if`s) then it works o.O
    @edit
    Problem solved Thread Reserved for next problems
    I made Ed instead of string "Ed"
    Last edited by buluss; 05-30-2014 at 05:39 AM.

  2. #2
    iBot User pink_panther's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    4,075
    Mentioned
    49 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    178 Post(s)
    Reputation
    309
    Rep Power
    10
    Quote Originally Posted by buluss View Post
    Hello I just making a script and probably will need a little help with few things.


    Action 1
    Code:
    if Voc == Ed then
        setsettings("Settings\\Healer\\Rules\\Exura Vita\\Enabled", "yes") 
    
        setsettings("Settings\\Healer\\Rules\\Exura San\\Enabled", "no") 
    end
    In Setup i got
    Code:
    --Global Settings--
        Voc = "Ed" --(Ms,Ed,Rp)
    But bot dont change the settings. Like a bot don`t recognise the Variable called Voc... If i put setsettings only (without if`s) then it works o.O
    @edit
    Problem solved Thread Reserved for next problems
    I made Ed instead of string "Ed"

    You should check your debug log.

    You are trying to compare a variable Voc to a string, but Ed is not a string, "Ed" IS a string.

    You need to say:

    Lua Code:
    if Voc == "Ed" then


    However, doign this, if the person types "ed" in the setup then Voc == "Ed" will return fase, because it has a capital E, you would need to then use Voc.lower == "ed"


    That being said, you should delete that setting from the Setup completely, and just do this:

    Lua Code:
     if vocation == 4 then
        setsettings() ect...


    vocation returns the players Vocation

    0: No Vocation.
    1: Knight / Elite Knight.
    2: Paladin / Royal Paladin.
    3: Sorcerer / Master Sorcerer.
    4: Druid / Elder Druid.
    Last edited by pink_panther; 05-31-2014 at 12:44 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
  •