Results 1 to 5 of 5

Thread: Need Some Help :)

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

    Need Some Help :)

    I'm new to the bot, but would like to get into writing my own scripts. The problem I have run into on my first script is as follows.

    I would like to loot spears from trolls if < x in my hand / backpack, and put them in my hand.

    How should I go about doing this?

    All help is greatly appreciated!

    Thanks!
    Jon

  2. #2
    Normal User Damyrup's Avatar
    Join Date
    Apr 2013
    Location
    www.ssocialscripts.com
    Posts
    238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    40
    Rep Power
    4
    I'm not scripting myself, but my first thought is an action enabeling/disabling the looting of Spears, and make it like if true spear =< value then enable the looting of spear

  3. #3
    Normal User
    Join Date
    Jul 2013
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    4
    Thanks for your answer, Damyrup!
    I agree with your reply, I'm just not sure exactly how to write it correctly.

  4. #4
    Normal User
    Join Date
    Jul 2013
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    4
    Bump

  5. #5
    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
    Create a new refiller action:
    Click image for larger version. 

Name:	Figure 1.PNG 
Views:	5 
Size:	17.2 KB 
ID:	17174


    Note that Enabled and ItemRefiller dont matter, just leave them as "no" and 0.

    Next, add "spear" to your loot list

    Then add this to an action:
    PHP Code:
    local nameAmmo "Spear" -- Ammo to use
    local maxAmmo 15 -- Max ammo to loot
    local minCap 
    100 -- Min Cap to stop looting Ammo

    setsettings
    ("Settings\\Refiller\\Rules\\Ammo\\ItemRefiller"itemid(nameAmmo)) -- This will change your refiller item to whatever you set your ammo as

    if 
    weaponamount+itemcount(nameAmmo) < maxAmmo and cap minCap then -- This will check to see if you have enough cap, and less than the max ammo 
        setsettings
    ("Settings\\Refiller\\Rules\\Ammo\\Enabled""yes") -- This turns on your refiller actionit will loot your ammo items right out of dead bodies
    else
        
    setsettings("Settings\\Refiller\\Rules\\Ammo\\Enabled""no") -- This turns off your refiller action, if you have low cap, or enough ammo
    end 
    Happy to help further or answer any other questions you have regarding writing your own scripts.
    Last edited by pink_panther; 08-13-2013 at 04:30 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
  •