Code: Select all
local timeInvited = nil;
local timeDeclineDelay = 2 + math.random(7);
function declineInvite_OnUpdate()
if( timeInvited ~= nil and os.difftime(os.time(), timeInvited) > timeDeclineDelay ) then
Code: Select all
local timeInvited = nil;
local timeDeclineDelay = 2 + math.random(7);
function declineInvite_OnUpdate()
if( timeInvited ~= nil and os.difftime(os.time(), timeInvited) > timeDeclineDelay ) then
yes, i want a autodecline invite in trade, duel and party.lisa wrote:So you just want bot to autodecline invites?
If you want the addon to be somehow called from the bot I would need a lot more code then what you posted. Somewhere else in the addon it will be giving timeInvited a value of not nil otherwise it would never work.
Code: Select all
if [b](this its the code that i unknow) [/b] then
RoMScript("StaticPopup_OnClick(StaticPopup1, 2);")
printf("decline for party/duel/trade ");
soundPlay(soundresource);
end
I don't know if I understand you. I have the addon "d303fix". I send you my original addon. it works fine, but i prefer work how userfuncionSomewhere else in the addon it will be giving timeInvited a value of not nil otherwise it would never work.
lisa wrote:If the addon works fine then I would stick with it.
Trouble is with doing the same thing with the bot is we would need to create a monitoring of those events which would put more load on the bot usage.
The game itself already monitors such events and makes it much easier to use an addon to deal with declining.
If there wasn't an addon then you could probably search memory for the pop and what causes it to monitor it without constantly sending macros to in game but since the addon already exists I would just use it.
Code: Select all
if( event == "PARTY_INVITE_REQUEST" ) then
if( event == "TRADE_REQUEST" ) then
Code: Select all
function checkinvite()
-- invite popup static address is 0x9EB8B8 4.0.4.2456
if memoryReadInt(getProc(), 0x9EB8B8) == 1 then
yrest(2000)
RoMScript("StaticPopup_OnClick(StaticPopup1, 2)")
if playalarm then
playalarm()
end
end
end
Code: Select all
unregisterTimer("Checkforpopup");
registerTimer("Checkforpopup", secondsToTimer(5), checkinvite);
Code: Select all
function checkinvite()
-- invite popup static address is 0x9EB8B8 4.0.4.2456
if remembertime then
if os.time() - remembertime > 5 then
RoMScript("StaticPopup_OnClick(StaticPopup1, 2)")
remembertime = nil
end
elseif memoryReadInt(getProc(), 0x9EB8B8) == 1 then
if playalarm then
playalarm()
end
remembertime = os.time()
end
end
Code: Select all
if os.time() - remembertime > 2 then
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 0 guests