Log in

View Full Version : Use item on x position (MINING SCRIPT)



aziz7361177
03-10-2016, 05:58 AM
Hello

I got this script from a friend but it only works on windoot, does anyone know how to change it into xenobot-readable?

if topitem($posx, $posy+1, $posz).id == 8506 then
useitemon(19203, 0, ground($posx, $posy+1, $posz))
else if topitem($posx, $posy+1, $posz).id == 8505 then
useitemon(19203, 0, ground($posx, $posy+1, $posz))
else if topitem($posx, $posy-1, $posz).id == 8506 then
useitemon(19203, 0, ground($posx, $posy-1, $posz))
else if topitem($posx, $posy-1, $posz).id == 8505 then
useitemon(19203, 0, ground($posx, $posy-1, $posz))
else if topitem($posx+1, $posy, $posz).id == 8505 then
useitemon(19203, 0, ground($posx+1, $posy, $posz))
else if topitem($posx+1, $posy, $posz).id == 8506 then
useitemon(19203, 0, ground($posx+1, $posy, $posz))
else if topitem($posx-1, $posy, $posz).id == 8505 then
useitemon(19203, 0, ground($posx-1, $posy, $posz))
else if topitem($posx-1, $posy, $posz).id == 8506 then
useitemon(19203, 0, ground($posx-1, $posy, $posz))
else if topitem($posx+1, $posy+1, $posz).id == 8505 then
useitemon(19203, 0, ground($posx+1, $posy+1, $posz))
else if topitem($posx+1, $posy+1, $posz).id == 8506 then
useitemon(19203, 0, ground($posx+1, $posy+1, $posz))
else if topitem($posx-1, $posy-1, $posz).id == 8505 then
useitemon(19203, 0, ground($posx-1, $posy-1, $posz))
else if topitem($posx-1, $posy-1, $posz).id == 8506 then
useitemon(19203, 0, ground($posx-1, $posy-1, $posz))
else if topitem($posx+1, $posy-1, $posz).id == 8505 then
useitemon(19203, 0, ground($posx+1, $posy-1, $posz))
else if topitem($posx+1, $posy-1, $posz).id == 8506 then
useitemon(19203, 0, ground($posx+1, $posy-1, $posz))
else if topitem($posx-1, $posy+1, $posz).id == 8505 then
useitemon(19203, 0, ground($posx-1, $posy+1, $posz))
else if topitem($posx-1, $posy+1, $posz).id == 8506 then
useitemon(19203, 0, ground($posx-1, $posy+1, $posz))
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end


It's a script that uses x pick on x rock when standing next to it.

Would really appreciate it, thanks!

krille09
03-10-2016, 06:11 AM
Self.UseItemWithGround(itemid, x, y, z)

aziz7361177
03-10-2016, 10:50 AM
What about this code:
else if topitem($posx-1, $posy+1, $posz).id == 8506 then
else if topitem($posx-1, $posy+1, $posz).id == 8505 then
?

I think it uses item if the "8506 / 8505" is anywhere near me (north-south-east-west) of my character.

Merre
03-10-2016, 12:28 PM
Module.New("RockMining", function(mod)
ItemToUse = 3003
ID = {8506, 8505}
for y = -1, 1 do
for x = -1, 1 do
if table.contains(ID, Map.GetTopUseItem(Self.Position().x+x, Self.Position().y+y, Self.Position().z).id) then
Self.UseItemWithGround(ItemToUse, Self.Position().x+x, Self.Position().y+y, Self.Position().z)
end
end
end
mod:Delay(2500, 5000)
end)

biff
03-12-2016, 12:43 PM
Is there any way to get the bot to move to the rocks by it self also?