• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Help with fishing rod

morphsx

New Member
Joined
Sep 14, 2012
Messages
7
Reaction score
0
Location
Ribeirao Preto - SP - Brasil
Hello guys, i'm trying to make a separate button to use the fishing rod, but i'm having some trouble... Here's my code:

Code:
local rodButton

function init()
	
	rodButton = modules.client_topmenu.addRightGameToggleButton('rodButton', tr('Vara de Pesca') .. ' ', '/images/topbuttons/rod', use)
end

function use()
	local player = g_game.getLocalPlayer()
	g_game.useInventoryItemWith(player:getInventoryItem(2):getId())
end

This way, it simply does nothing.
If I change "g_game.useInventoryItemWith..." to "g_game.useInventoryItem(...", when i click the button i receive a "sendCancel" saying "Sorry, not possible"

I would like some help, as I made exactly the same code strucutre for opening backpack, and it worked... but for "UseWith" items, it doesn't work...

Thanks in advance!
 
Hmm thanks for the answer, but didn't work either... I think it should be "...Item(2)" as my fishing rod stays on the neck slot.
I saw something like this in the auto-fishing script of the otclient candybot:

Code:
g_game.useInventoryItemWith(itemId, thing)

What does the "thing" part means?
Do I have to use something similar?
 
Back
Top