Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: How to Identify And Fix Actions Problems

  1. #1
    iBot User Dehan's Avatar
    Join Date
    May 2012
    Location
    www.ssocialscripts.com
    Posts
    910
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    114
    Rep Power
    7

    How to Identify And Fix Actions Problems

    Today I realized that many people posts on forum asking help for actions that doesn't work and they have to wait a little bit to get it solved when on the most of the cases there is just miss spelling or bad coding (which includes: missing parameters, parameters set wrong, functions that doesn't even exists, ...)


    1. How to know if my action has something wrong?

    Everything wrong that happens with iBot scripting is shown on Debug. To open it just follow the image:


    If something went wrong you will see an error message:



    2. Reading Debug Errors


    First of all we need to extract informations of our error message. On this section we are going to use the following example:
    12:47 : LUA:DoAction:SafeBank: - LuaInterface.LuaScriptException: [string "chunk"]:2: ')' expected (to close '(' at line 1) near 'local'

    It may sounds creepy but it gives everything we need to fix our problem.

    LUA:DoAction:SafeBank:
    Here we can identify what is returing error and where it is located.:

    • DoAction: Says by itself, it is a coding problem
    • SafeBank: Our Action name which has the error. The name may vary, if the action is located on cavebot it is only going to return: LUA:DoAction:Cavebot and not exactly the Cavebot action where it is located, so you have to pay attention on it. The same happens for HUD and so on (LUA:DoAction:HUD)

    LuaInterface.LuaScriptException: [string "chunk"]:2: ')' expected (to close '(' at line 1) near 'local'
    Here we can read some details about our errror

    • LuaInterface.LuaScriptException: [string "chunk"]: An Exception occured, so iBot is not able to perform the action.
    • 2: Line number where the error is (sometimes you have to check one line before or after to identify it)
    • ')' expected (to close '(' at line 1) near 'local' Some aditional information about your issue.



    3. Solving Debug Errors
    Here you can find some examples of debug errors, if you need something just use CTRL + F (browser find function) and paste your 'aditional information'.


    Action:
    Code:
    local TOTAL = (itemcount('gold coin') + itemcount('platinum coin')
    if TOTAL > 0 then
    depositall()
    end
    Error Message: LUA:DoAction:SafeBank: - LuaInterface.LuaScriptException: [string "chunk"]:1: ')' expected (to close '(' at line 1) near 'local'
    Problem: Scripter forgot to close the () before itemcount().
    Action Working:
    Code:
    local TOTAL = (itemcount('gold coin') + itemcount('platinum coin'))
    if TOTAL > 0 then
    depositall()
    end



    Action:
    Code:
    if hppc < 80 and cancast("exura")
    cast("exura")
    end
    Error Message: LUA:DoAction:Healing: - LuaInterface.LuaScriptException: [string "chunk"]:2: 'then' expected near 'cast'
    Problem: if asks for then. Here you have to check 1 line before, in this case, line number 1.
    Action Working:
    Code:
    if hppc < 80 and cancast("exura") then
    cast("exura")
    end



    Action:
    Code:
    while hppc < 80 and cancast("exura")
    cast("exura")
    end
    Error Message: LUA:DoAction:Healing: - LuaInterface.LuaScriptException: [string "chunk"]:2: 'do' expected near 'cast'
    Problem: while asks for do. Here you have to check 1 line before, in this case, line number 1.
    Action Working:
    Code:
    while hppc < 80 and cancast("exura") do
    cast("exura")
    end



    Action:
    Code:
    if itemcount("gold coin") > 0 then
    moveitems("gold coin", MainBP, 'ground', 100)
    end
    Error Message: CaveBot:Input:FindItemLocal - System.NullReferenceException: Object reference not set to an instance of an object.
    at ohM=.thw=.Mh0=(String Nh0=, String Nx0=, Boolean OB0=, Int32 OR0=)
    Problem: There is no variables declared, anywhere. Bot cannot find the container where it is supposed to perform the action.
    Action Working:
    Code:
    local MainBP = "blue backpack"
    if itemcount("gold coin") > 0 then
    moveitems("gold coin", MainBP, 'ground', 100)
    end



    Action:
    Code:
    if paround(7, false) > 0 then
        sy("wazzup bro")
        wait(30000)
    end
    Error Message: LUA:DoAction:Action1: - LuaInterface.LuaScriptException: [string "chunk"]:2: attempt to call global 'sy' (a nil value)
    Problem: iBot doesnt know the function sy(). In this case it was miss spelling. Click here for a list of variables and functions.
    Action Working:
    Code:
    if paround(7, false) > 0 then
        say("wazzup bro")
        wait(30000)
    end



    Action:
    Code:
    iscreatureontile("west", "south", "east")
    Error Message: LUA:DoAction:Action1: - LuaInterface.LuaScriptException: [string "chunk"]:1: invalid arguments to method call
    Similar Error Message:LUA:DoAction:Action1: - LuaInterface.LuaScriptException: C:\path to iBot folder\iBot\library\Standard.lua:582: A .NET exception occured in user-code
    Problem: You are using wrong values for your function. In this example we should only use INTEGER values but we were using STRING values.
    Click here for a detailed list of variables and functions.
    Action Working:
    Code:
    iscreatureontile(posx-1, posy+1, posx+1)



    Feel free to post something that I may had forget and I will add it to the topic.

    Yours,
    Dehan
    Last edited by Dehan; 10-14-2013 at 11:35 AM.
    Check out - Dehan Accounts Service!

    Proud Scripter of BUgWT STAFF

  2. #2
    Banned
    Join Date
    Jun 2012
    Location
    Internet
    Posts
    845
    Mentioned
    9 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    3 Post(s)
    Reputation
    113
    Rep Power
    0
    cool rep+.

  3. #3
    Banned
    Join Date
    Jun 2012
    Location
    Ceará
    Posts
    2,114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    81
    Rep Power
    0
    This was veeery needed, stickied.

  4. #4
    Normal User mistgun's Avatar
    Join Date
    Nov 2012
    Location
    LDZ
    Posts
    333
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    3 Post(s)
    Reputation
    41
    Rep Power
    5
    Clearly and smooth! Rep +
    LATEST FREE AND PAID SCRIPTS

    Ghostland: EK Coryms Cave: EK
    Peninsula Tomb: EK, MS/ED Mount Sternum: EK
    Dwarf City: EK Nightstalkers Mountain: ED, MS

  5. #5
    iBot User Dehan's Avatar
    Join Date
    May 2012
    Location
    www.ssocialscripts.com
    Posts
    910
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    114
    Rep Power
    7
    Quote Originally Posted by mistgun View Post
    Clearly and smooth! Rep +
    Quote Originally Posted by GabrielTOTS View Post
    This was veeery needed, stickied.
    Quote Originally Posted by Rasputin View Post
    cool rep+.

    Thank you all, and feel free to tell me to add something if needed
    Check out - Dehan Accounts Service!

    Proud Scripter of BUgWT STAFF

  6. #6
    Banned
    Join Date
    Jun 2012
    Location
    Ceará
    Posts
    2,114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    81
    Rep Power
    0
    When I use Creature.GetAll("m") or using filter "p" i get the error .net exception, do you know why this is happening ?

  7. #7
    iBot User Dehan's Avatar
    Join Date
    May 2012
    Location
    www.ssocialscripts.com
    Posts
    910
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    114
    Rep Power
    7
    Quote Originally Posted by GabrielTOTS View Post
    When I use Creature.GetAll("m") or using filter "p" i get the error .net exception, do you know why this is happening ?
    how are you using it? Here when I print the function it works perfect.

    remember that it is a function from sirmate's library
    Last edited by Dehan; 10-14-2013 at 03:04 PM.
    Check out - Dehan Accounts Service!

    Proud Scripter of BUgWT STAFF

  8. #8
    Normal User StaR Scripts's Avatar
    Join Date
    Sep 2013
    Location
    Manchester, England
    Posts
    156
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    1 Post(s)
    Reputation
    16
    Rep Power
    4
    Good idea for a thread, nice rep+

  9. #9
    Premium User Eldar's Avatar
    Join Date
    Apr 2013
    Location
    Poland
    Posts
    1,335
    Mentioned
    37 Post(s)
    Tagged
    2 Thread(s)
    Quoted
    62 Post(s)
    Reputation
    159
    Rep Power
    7
    Good work! Rep+

  10. #10
    iBot User skullzin's Avatar
    Join Date
    Feb 2012
    Location
    Brazil,Curitiba
    Posts
    598
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    12 Post(s)
    Reputation
    24
    Rep Power
    6
    Good work!
    rep+
    waiting for a brazilian version
    TE AJUDEI ? REP+

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
  •