Posts: 9
Threads: 5
Joined: Nov 2020
Reputation:
0
Hey, can someone make script when i got trap by pot/box/chest from around me. Push this pot/box/chest to water.
or second one:
Use Noble Axe to destroy all box/pot/chest around me ?
Posts: 2,948
Threads: 492
Joined: Jul 2018
Reputation:
84
antifurnituretrap(string WEAPON_NAME_ID, string/number trashIds) -- Searches for the listed ids and try to destroy.
local TRASH_IDS = { 1234, 1234, 1234, 1234, 1234 } -- Ids to destroy.
local WEAPON_ID = 1234 -- Weapon id to be used to destroy.
antifurnituretrap(WEAPON_ID, table.unpack(TRASH_IDS))
boolean istrapped() -- Returns if you are trapped by items and/or creatures
boolean istrappedcreatures() -- Returns if you are trapped by creatures.
Script #1.
local WATER_IDS = { } -- Place water ids, it will search for those ids to get its location throw trash.
local TRASH_IDS = { 1234, 1234, 1234, 1234, 1234 } -- Ids to throw in the water.
local STAND_TIME = 20000 -- IN MILLISECONDS. Trigger if you stand on same location for more than this value
if istrapped() or standtime() >= STAND_TIME then
local player_x = posx()
local player_y = posy()
local player_z = posz()
local TRASH_TABLE = { ID = 0, X = 0, Y = 0, Z = 0 }
local WATER_TABLE = { ID = 0, X = 0, Y = 0, Z = 0 }
local tiles = gettiles()
for _, tile in ipairs(tiles) do
if tile.itemcount > 1 and tile.posz == player_z then
for __, item in ipairs(tile.items) do
if TRASH_TABLE.ID == 0 and math.abs(tile.posx - player_x) <= 1 and math.abs(tile.posy - player_y) <= 1 and table.find(TRASH_IDS, item.id) ~= nil then
TRASH_TABLE.ID = item.id
TRASH_TABLE.X = tile.posx
TRASH_TABLE.Y = tile.posy
TRASH_TABLE.Z = tile.posz
elseif WATER_TABLE.ID == 0 table.find(WATER_IDS, item.id) ~= nil then
if isshootable(tile.posx, tile.posy, false) then
WATER_TABLE.ID = item.id
WATER_TABLE.X = tile.posx
WATER_TABLE.Y = tile.posy
WATER_TABLE.Z = tile.posz
end
end
if TRASH_TABLE.ID > 0 and WATER_TABLE.ID > 0 then
break
end
end
end
if TRASH_TABLE.ID > 0 and WATER_TABLE.ID > 0 then
break
end
end
if TRASH_TABLE.ID > 0 and WATER_TABLE.ID > 0 then
moveitems(TRASH_TABLE.ID, ground(WATER_TABLE.X, WATER_TABLE.Y, WATER_TABLE.Z), ground(TRASH_TABLE.X, TRASH_TABLE.Y, TRASH_TABLE.Z), 100)
end
end
Script #2
local TRASH_IDS = { 1234, 1234, 1234, 1234, 1234 } -- Ids to throw in the water.
local WEAPON_ID = 1234 -- Weapon id to be used to destroy.
local STAND_TIME = 20000 -- IN MILLISECONDS. Trigger if you stand on same location for more than this value
if istrapped() or standtime() >= STAND_TIME then
local player_x = posx()
local player_y = posy()
local player_z = posz()
local TRASH_TABLE = { ID = 0, X = 0, Y = 0, Z = 0 }
local WATER_TABLE = { ID = 0, X = 0, Y = 0, Z = 0 }
local tiles = gettiles()
for _, tile in ipairs(tiles) do
if tile.itemcount > 1 and math.abs(tile.posx - player_x) <= 1 and math.abs(tile.posy - player_y) <= 1 and tile.posz == player_z then
for __, item in ipairs(tile.items) do
if TRASH_TABLE.ID == 0 and table.find(TRASH_IDS, item.id) ~= nil then
TRASH_TABLE.ID = item.id
TRASH_TABLE.X = tile.posx
TRASH_TABLE.Y = tile.posy
TRASH_TABLE.Z = tile.posz
end
if TRASH_TABLE.ID > 0 then
break
end
end
end
if TRASH_TABLE.ID > 0 then
break
end
end
if TRASH_TABLE.ID > 0 then
useitemon(WEAPON_ID, ground(TRASH_TABLE.X, TRASH_TABLE.Y, TRASH_TABLE.Z), '')
end
end
Posts: 9
Threads: 5
Joined: Nov 2020
Reputation:
0
Posts: 13
Threads: 2
Joined: Jan 2022
Reputation:
0
|Only Registered members can see download links. | Click here to buy subscription or here to register.
Trying the first one but having a hard time finding IDs for some of the furnitures, is theres a way to check IDs in game or could u maybe add most of the furnitures in it ?
Posts: 2,948
Threads: 492
Joined: Jul 2018
Reputation:
84
Unfortunately, only servers-side really knows which are the furniture that blocks path but can be destroyed.
I would say the fastest way would be to go to NPCs and buy all kinds of furniture possible, as well as walking around town. I also recommend that you create alerts for when your character has been stuck or standing still for too long, so you can go back and find the Id of the item that is holding you back.
Posts: 13
Threads: 2
Joined: Jan 2022
Reputation:
0
|Only Registered members can see download links. | Click here to buy subscription or here to register.But how do I check the IDs of the furniture in game ? is there a check ID feature in the bot that i havent found ?
Posts: 2,948
Threads: 492
Joined: Jul 2018
Reputation:
84
Hello.
|Only Registered members can see download links. | Click here to buy subscription or here to register.
No, you can only check items ids that you have found.
Posts: 10
Threads: 2
Joined: Dec 2019
Reputation:
0
Hello,
Using below code with runemaking. However if someone throws in a pot in the house for example. The character will reach the pot, destroy it and then just stand still and never alana sio out. Is there a way for the character to alana sio out after everything is destroyed OR only destroy things that are around you/in the door.
Thanks
local TRASH_IDS = {3465, 2472, 2523, 2519, 2319, 2524, 2472, 2480, 2481, 2482, 2431, 2432, 2433, 2434, 2314} -- Ids to destroy.
local WEAPON_ID = 3274 -- Weapon id to be used to destroy.
antifurnituretrap(WEAPON_ID, table.unpack(TRASH_IDS))
Posts: 13
Threads: 2
Joined: Jan 2022
Reputation:
0
01-21-2022, 06:33 PM
(This post was last modified: 01-21-2022, 06:33 PM by shuno11.)
|Only Registered members can see download links. | Click here to buy subscription or here to register.
Does ur script destroy Pot with id 3465? cuz i cant get mine to do it for some reason
Posts: 2,948
Threads: 492
Joined: Jul 2018
Reputation:
84
01-21-2022, 06:50 PM
(This post was last modified: 01-21-2022, 06:50 PM by Arkilys.)
Hello.
@ shuno11
Please, redownload and reinstall Kasteria OTBot. There was a small bug on that function that I just fixed.
@ Sunflake
No, runemaker is Why don't you simply check your position
Please, redownload and reinstall Kasteria OTBot. There was a small bug on that function that I just fixed.
Runemaker is not integrated with your LUA scripts. I think you should use LUA functions to find out what Runemaker is doing and then take some action.
runemaker_isondanger() [boolean] -> returns true if runemaker is currently in danger.
runemaker_isondangerconditions() [number] -> returns a number that should be used to check under which danger conditions you are, use bitwise.
runemaker_isrefilling() [boolean] -> returns true if runemaker is refilling.
Runemaker has a Character option where you configure your character's position to possibly walkback, so even if the LUA script walks somewhere else, Runemaker will walk back.
antifurnituretrap() returns boolean if it tried to destroy an item. Then you can check the function return and check its position (or not) and speak alana sio.
|