Signup Now
Results 1 to 1 of 1
  1. #1
    Free User
    Join Date
    Oct 2016
    Posts
    45
    Reputation
    17
    Rep Power
    0

    Need advice for this script

    I figured it out using locals, thanks to another script which I modified quite a bit to get it to work. Not sure who it was that wrote it but if I find out I will def give credit in the script.

    function lowsupply()
    if getuseroption("UseSpear") then return itemcount("SpearType") <= getuseroption("SpearLeave") or itemcount("HealthType") <= getuseroption("HealthToLeave") or itemcount("ManaType") <= getuseroption("ManaToLeave")
    elseif getuseroption("UseArrow") then return itemcount("ArrowType") <= getuseroption("ArrowLeave") or itemcount("HealthType") <= getuseroption("HealthToLeave") or itemcount("ManaType") <= getuseroption("ManaToLeave")
    elseif getuseroption("UseBolt") then return itemcount("BoltType") <= getuseroption("BoltLeave") or itemcount("HealthType") <= getuseroption("HealthToLeave") or itemcount("ManaType") <= getuseroption("ManaToLeave")
    end
    end


    I am thinking the one below, keep in mind it may be written wrong, will just check all say health types and return it as always low.

    local HealthItems = {266, 236, 7642, 23374}
    local SpearItems = {7367, 277, 7378, 3347, 21158}
    local ManaItems = {237, 268}
    local ArrowItems = {3447, 3449, 3239, 15793, 774, 16143, 761, 763, 7365, 3448, 762, 21470, 7364, 14251}
    local BoltItems = {3446, 16142, 6528, 7363, 16141, 3450, 14252}

    function lowsupply()
    if getuseroption("UseSpear") then return itemcount(SpearItems) <= getuseroption("SpearLeave") or itemcount(HealthItems) <= getuseroption("HealthToLeave") or itemcount(ManaItems) <= getuseroption("ManaToLeave")
    elseif getuseroption("UseArrow") then return itemcount(ArrowItems) <= getuseroption("ArrowLeave") or itemcount(HealthItems) <= getuseroption("HealthToLeave") or itemcount(ManaItems) <= getuseroption("ManaToLeave")
    elseif getuseroption("UseBolt") then return itemcount(BoltItems) <= getuseroption("BoltLeave") or itemcount(HealthItems) <= getuseroption("HealthToLeave") or itemcount(ManaItems) <= getuseroption("ManaToLeave")
    end
    end


    So.. The function didn't work, still looking for an easier solution but this is what I have for now..


    if getuseroption("UseSpear") then while getuseroption("SpearType") <= getuseroption("SpearLeave") or getuseroption("HealthType") <= getuseroption("HealthToLeave") or getuseroption("ManaType") <= getuseroption("ManaToLeave") do
    if $wptsection == "Hunt" and $attacked.id == 0 and not $trapped then
    gotolabel("LeaveHunt", "Leave")
    end
    end
    elseif getuseroption("UseArrow") then while getuseroption("ArrowType") <= getuseroption("ArrowLeave") or getuseroption("HealthType") <= getuseroption("HealthToLeave") or getuseroption("ManaType") <= getuseroption("ManaToLeave") do
    if $wptsection == "Hunt" and $attacked.id == 0 and not $trapped then
    gotolabel("LeaveHunt", "Leave")
    end
    end
    elseif getuseroption("UseBolt") then while getuseroption("BoltType") <= getuseroption("BoltLeave") or getuseroption("HealthType") <= getuseroption("HealthToLeave") or getuseroption("ManaType") <= getuseroption("ManaToLeave") do
    if $wptsection == "Hunt" and $attacked.id == 0 and not $trapped then
    gotolabel("LeaveHunt", "Leave")
    end
    end
    end
    end



    That seems to have failed also, is there a function that would get the user option of the selected type of ammo?
    Last edited by lyagami; 12-25-2016 at 11: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
  •