# Ropiderz library v 0.0.1 #
# METHODS #
def explanation(string_method) # says on npc channel an explanation of method you put on #
method = {"explanation" => "explain the ropiderz lib method you put on", "countgold" => "return amount of gold you have", "reachandopendp" => "reach dp and open it if not true that is opened return to same waypoint", "depositall" => "says hi, deposit all, yes", "forwardwpt" => "go to next waypoint", "backwarkwpt" => "go to previous waypoint", "alltiles" => "return array of all tiles in visible screen", "aroundtiles" => "return array of all tiles around your character one sqm far", "hpcount" => "return amount of health potions you have all types", "mpcount" => "return amount of mana potions you have all types", "healfriend" => "will use sio to heal a friend named on method when he gots health percent on method", "emptycount" => "return amount of empty slots on all backpacks", "usemacheteon" => "cuts grass on cords XYZ defined", "usepickon" => "uses pick or other stuff to open a hole on cords XYZ defined", "useshovelon" => "uses shovel or other stuff avaible to open loose stone pile on cord XYZ defined", "useropeon" => "uses rope or other stuff avaible on cord XYZ defined", "antiidle" => "will keeps turning into random direction in time between from and to"}
if string_method.include?(method)
say(method[string_method].to_s)
else
say("This method does not exists on Ropiderz Library")
end
end
def countgold() # return amount of gold you have #
return itemcount(3031) + (itemcount(3035) * 100) + (itemcount(3043) * 10000)
end
def depositall() # says "hi", "deposit all", "yes" #
say("hi")
wait(1000, 1500)
npcsay("deposit all")
wait(1000, 1500)
npcsay("yes")
end
def reachandopendp() # reach dp and open it, if not true that is opened return to same waypoint #
reachdp()
wait(2500, 3000)
if reacheddp() == false
gotoway(wpt())
else
opendepot()
wait(2500, 3000)
end
end
def forwardwpt() # go to next waypoint #
gotoway(wpt() + 1)
end
def backwardwpt() # go to previous waypoint #
gotoway(wpt() - 1)
end
def alltiles() # return array of all tiles in visible screen #
while true
x = -7 + rand(14)
y = -5 + rand(10)
tile = gettile($posx + x, $posy + y, $posz)
end
return tile
end
def aroundtiles() # return array of items in all tiles around your character 1 sqm far #
while true
x = -1 + rand(2)
y = -1 + rand(2)
tile = gettile($posx + x, $posy + y, $posz)
tile.items.each do |tileeach|
end
end
return tileeach
end
def healfriend(friend_name, percent) # heal friend with sio in health percent rule #
while true
creature("ps").each do |player|
if player.Name == friend_name && player.hppc < percent
cast("exura sio " + friend_name)
sleep 1.5
end
end
end
end
def emptycount() # return amount of empty slots on all backpacks #
while true
backpack.each do |bp|
return bp.maxcount
end
end
end
def itemcounton(id, bpname) # count items with id "item id" on backpack "backpack name" #
backpack.each do |bp|
bp.item.each do |i|
i.itemid do |item|
if item == id and i.container_name == bpname
return countitems(id)
end
end
end
end
end
def mpcount() # returns amount of mana potions all types #
return itemcount(getid("mana potion")) + itemcount(getid("strong mana potion")) + itemcount(getid("great mana potion"))
end
def hpcount() # returns amount of health potions all types #
return itemcount(getid("small health potion")) + itemcount(getid("health potion")) + itemcount(getid("strong health potion")) + itemcount(getid("great health potion")) + itemcount(getid("ultimate health potion"))
end
def usemacheteon(x, y, z) # cuts grass on tile xyz defined #
if itemcount("machete") > 0
mach = getid("machete")
elsif itemcount("whacking driller of fate") > 0
mach = getid("whacking driller of fate")
elsif itemcount("sneaky stabber of eliteness") > 0
mach = getid("sneaky stabber of eliteness")
elsif itemcount("squeezing gear of girlpower") > 0
mach = getid("squeezing gear of girlpower")
end
useitemfrombpon(mach, x, y, z)
end
def usepickon(x, y, z) # uses pick on tile xyz defined #
if itemcount("pick") > 0
pickid = getid("pick")
elsif itemcount("whacking driller of fate") > 0
pickid = getid("whacking driller of fate")
elsif itemcount("sneaky stabber of eliteness") > 0
pickid = getid("sneaky stabber of eliteness")
elsif itemcount("squeezing gear of girlpower") > 0
pickid = getid("squeezing gear of girlpower")
end
useitemfrombpon(pickid, x, y, z)
end
def useshovelon(x, y, z) # uses shovel on tile xyz defined #
if itemcount("shovel") > 0
shovelid = getid("shovel")
elsif itemcount("light shovel") > 0
shovelid = getid("light shovel")
elsif itemcount("whacking driller of fate") > 0
shovelid = getid("whacking driller of fate")
elsif itemcount("sneaky stabber of eliteness") > 0
shovelid = getid("sneaky stabber of eliteness")
elsif itemcount("squeezing gear of girlpower") > 0
shovelid = getid("squeezing gear of girlpower")
end
useitemfrombpon(shovelid, x, y, z)
end
def useropeon(x, y, z) # uses rope on tile xyz defined #
if itemcount("rope") > 0 {
ropeid = getid("rope") }
elsif itemcount("elvenhair rope") > 0 {
ropeid = getid("elvenhair rope") }
elsif itemcount("whacking driller of fate") > 0 {
ropeid = getid("whacking driller of fate") }
elsif itemcount("sneaky stabber of eliteness") > 0 {
ropeid = getid("sneaky stabber of eliteness") }
elsif itemcount("squeezing gear of girlpower") > 0 {
ropeid = getid("squeezing gear of girlpower") }
end
useitemfrombpon(ropeid, x, y, z)
end
def antiidle(timefrom, timeto) # it will turn directions randomly between time 'from' and 'to' #
while true
rin = timefrom * 1000
out = timeto * 1000
randomly = 0 + rand(4)
if randomly == 1
turn("n")
wait(rin, out)
end
if randomly == 2
turn("s")
wait(rin, out)
end
if randomly == 3
turn("w")
wait(rin, out)
end
if randomly == 4
turn("e")
wait(rin, out)
end
end
end