Signup Now
Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17
  1. #11
    Moderator Raphael's Avatar
    Join Date
    Dec 2013
    Location
    raphseller.com
    Posts
    2,441
    Reputation
    309
    Rep Power
    28
    Go Help > Console, type and run this:

    local ammuMax = getuseroption("AmmuMax")
    print(type(ammuMax), ammuMax)


    Post the result here.

  2. #12
    Free User sylomex's Avatar
    Join Date
    Dec 2013
    Location
    France
    Posts
    369
    Reputation
    39
    Rep Power
    21
    here is the result :

    string 13

  3. #13
    Free User sylomex's Avatar
    Join Date
    Dec 2013
    Location
    France
    Posts
    369
    Reputation
    39
    Rep Power
    21
    bump for raphi !

  4. #14
    Moderator Raphael's Avatar
    Join Date
    Dec 2013
    Location
    raphseller.com
    Posts
    2,441
    Reputation
    309
    Rep Power
    28
    Okay, try this then on the action you said isn't working:

    auto(100)

    if $rhand.count < tonumber(getuseroption("AmmuMax")) then
    setsetting('Looting/LootList/spear/Action', 'Loot')
    else
    setsetting('Looting/LootList/spear/Action', 'Ignore')
    end

  5. #15
    Free User sylomex's Avatar
    Join Date
    Dec 2013
    Location
    France
    Posts
    369
    Reputation
    39
    Rep Power
    21
    actions is still working but i reload the script here are the 2 errors i got now :

    error in Persistent script speaschecker:
    ["if $rhand.count < tonumber(Maxspears) ..."]:speaschecker:5 attempt to compare number with nil
    error in Persistent script spearschanger:
    ["if $rhand.count < tonumber(getuseropt..."]:spearschanger:3 attempt to compare number with nil
    Spearschecker :


    local spears = 3277 -- id of spear
    local Maxspears = getuseroption("AmmuMax")

    auto(100)
    if $rhand.count < tonumber(Maxspears) then
    equipitem(spears, 'rhand')
    end


    Spearchanger :


    [FONT=Courier New]auto(100)[/FONT] [FONT=Courier New]
    [/FONT]
    [FONT=Courier New]if $rhand.count < tonumber(getuseroption("AmmuMax")) then[/FONT]
    [FONT=Courier New]setsetting('Looting/LootList/spear/Action', 'Loot')[/FONT]
    [FONT=Courier New]else[/FONT]
    [FONT=Courier New]setsetting('Looting/LootList/spear/Action', 'Ignore')[/FONT]
    [FONT=Courier New]end[/FONT]

    Last edited by sylomex; 12-21-2013 at 01:10 PM.

  6. #16
    Moderator Raphael's Avatar
    Join Date
    Dec 2013
    Location
    raphseller.com
    Posts
    2,441
    Reputation
    309
    Rep Power
    28
    auto(100)
    local ammuMax = getuseroption("AmmuMax")

    print({'ammuMax', ammuMax, type(ammuMax)})
    print({'$rhand.count', $rhand.count, type($rhand.count)})

    if $rhand.count < tonumber() then
    setsetting('Looting/LootList/spear/Action', 'Loot')
    else
    setsetting('Looting/LootList/spear/Action', 'Ignore')
    end

  7. #17
    Free User sylomex's Avatar
    Join Date
    Dec 2013
    Location
    France
    Posts
    369
    Reputation
    39
    Rep Power
    21
    here are the results of the print

    {"ammuMax", "13", "string"}
    {"$rhand.count", 13, "number"}
    error in Persistent script spearschanger:
    [" if $rhand.count < tonumber() ..."]:spearschanger:9 bad argument #1 to 'tonumber' (value expected)
    stack traceback:
    [" if $rhand.count < tonumber() then"]:spearschanger:9 in user script

 

 

Posting Permissions

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