Results 1 to 8 of 8

Thread: Help me with my energy ring script :)

  1. #1
    Normal User
    Join Date
    May 2013
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    4

    Help me with my energy ring script :)

    It's supposed to move a energy ring to the ring slot if theres more than 4 frost dragons/frost dragon hatchlings on the screen. And if not, its gonna use the crystal ring instead :P


    local ring = "energy ring"
    local dring = "crystal ring"
    local monster = "Frost dragon", "Frost dragon hatchling"
    local mcount = 4

    If (maround(7, monster) >= mcount)
    then
    moveitems(itemid(ring), "all", "ring", 1)
    else
    moveitems(itemid(dring), "all", "ring", 1)
    end

  2. #2
    Normal User xavizus's Avatar
    Join Date
    Jun 2013
    Location
    Japan
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    18
    Rep Power
    4
    Hi femax,

    If should be if (Case sensitive).

    if it is "if", then does anything happen at all?
    What does the debugger say?

  3. #3
    Normal User
    Join Date
    May 2013
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    4
    14:49 : LUA:PersistentAction - LuaInterface.LuaScriptException: [string "chunk"]:2: attempt to call global 'maround' (a nil value)
    14:49 : LUA:PersistentAction - LuaInterface.LuaScriptException: [string "chunk"]:33: attempt to call global 'maround' (a nil value)

    It's repeating that over and over again.
    And no, writing if didnt do any difference

  4. #4
    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 femax View Post
    It's supposed to move a energy ring to the ring slot if theres more than 4 frost dragons/frost dragon hatchlings on the screen. And if not, its gonna use the crystal ring instead :P
    PHP Code:
    local ring "energy ring"
    local dring "crystal ring"
    local mcount 4

    if maround(7"Frost Dragon","Frost Dragon Hatchling") >= mcount
    then
    moveitems
    (itemid(ring), "all""ring"1)
    else
    moveitems(itemid(dring), "all""ring"1)
    end 

  5. #5
    Normal User
    Join Date
    May 2013
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    4
    14:49 : LUA:PersistentAction - LuaInterface.LuaScriptException: [string "chunk"]:2: attempt to call global 'maround' (a nil value)
    14:49 : LUA:PersistentAction - LuaInterface.LuaScriptException: [string "chunk"]:33: attempt to call global 'maround' (a nil value)
    Still giving me that, thanks for the reply.
    Maybe there's something wrong with my bot?

  6. #6
    Normal User xavizus's Avatar
    Join Date
    Jun 2013
    Location
    Japan
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    18
    Rep Power
    4
    Quote Originally Posted by femax View Post
    14:49 : LUA:PersistentAction - LuaInterface.LuaScriptException: [string "chunk"]:2: attempt to call global 'maround' (a nil value)
    14:49 : LUA:PersistentAction - LuaInterface.LuaScriptException: [string "chunk"]:33: attempt to call global 'maround' (a nil value)
    Still giving me that, thanks for the reply.
    Maybe there's something wrong with my bot?
    I tried this (Some edited of your script) and I didn't get any errors. I will try your script as soon as I can
    PHP Code:
    local weapon "warrior's axe"
    if(maround(7"Hyena""Scarab""honour guard") > 0then
        moveitems
    (itemid(weapon), "all""weapon"1)
    else
        
    moveitems(itemid(weapon), "weapon""Red backpack"1)
    end 
    EDITED:

    I just tried your script above and it worked for me.

    Try to remove the action and add it once again and see if it works.
    Last edited by xavizus; 06-17-2013 at 11:54 AM.

  7. #7
    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
    lua isn't case sensitive, unless it is referencing a string value.

    therefore, you can use if, IF, iF or If

  8. #8
    Normal User
    Join Date
    May 2013
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    4
    14:15 : LUA:PersistentAction - LuaInterface.LuaScriptException: [string "chunk"]:5: attempt to call global 'maround' (a nil value)
    Nope, it really dont want to work

Tags for this Thread

Posting Permissions

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