Can't Cancel Deal with Macro Plug-in

Forum closed. All further discussion to be discussed at https://github.com/OpenKore/

Moderators: Moderators, Developers

Message
Author
lpeachl
Noob
Noob
Posts: 1
Joined: 24 Jan 2011, 08:41
Noob?: No

Can't Cancel Deal with Macro Plug-in

#1 Post by lpeachl »

i can't Cancel Deal with command "deal no" via "do deal no" in macro
with 'dealAuto' set to 0

even with

Code: Select all

do eval Commands::run("deal no")
or

Code: Select all

$result = @eval(Commands::run("deal no")) ### << $result return 1

It seem to work when 'dealAuto' set to 1
but the command run doubled (1 by AI's and 1 by macro)

with/without XKore i still can't cancel deal with macro

i already try old version of macro but no luck



my macro. (it's a Warp Services for sell. not finish bcoz of this bug so i post only part of it that broke)

Code: Select all

automacro XWSDealRequestEvent {
	##### xxx (Level yy) Requests a Deal
	console /(.*) \(level (.*)\) Requests a Deal/
	
	call XWSDealed
}

macro XWSDealed {
	$DealerName = $.lastMatch1
	$DealerLevel = $.lastMatch2
	
	if ($XWSStep != WaitAcceptDeal || $DealingName != $XWSServingName) call XWSCancelDeal

	#Accept the Deal
	do deal
}

macro XWSCancelDeal {
	pause 6
	log ...
	pause 1
	do deal no
	#do eval Commands::run("deal no")
	#$result = @eval(Commands::run("deal no"))
	pause 1
	log ...
}
Console

Code: Select all

XXXXX (level XX) Requests a Deal
[macro] automacro XWSDealRequestEvent triggered.
Type 'deal' to start dealing, or 'deal no' to deny the deal.
[macro log] ...
[macro log] ...
if i type 'deal no' to the console now it will cancel the deal.


and with 'dealAuto' set to 1.

Code: Select all

XXXXX (level XX) Requests a Deal
[macro] automacro XWSDealRequestEvent triggered.
Type 'deal' to start dealing, or 'deal no' to deny the deal.
Deal Cancelled
[macro log] ...
Error in function 'deal' (Deal a Player)
There is no incoming/current deal to cancel
[macro log] ...
only 'deal no' broke.
'deal', 'deal n' work fine.
i don't know if the fix for spamming "Deal Cancelled" broke this?




i use openkore version wwb-2.1 r7627.
connect to tRO (renewal) with help from Poseidon to bypass HShield.


PS.sorry 4 my bad english.
PS2.I'm not sure if it's macro bug or not. even if it's macro bug i don't know if i can post this in macro's general board. so i decide to post it here.

EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: Can't Cancel Deal with Macro Plug-in

#2 Post by EternalHarvest »

So other commands (when invoked via macro's "do") works, but not that one and it works when used manually?

Meanwhile, try that as a workaround (in "do eval"/@eval):

Code: Select all

$messageSender->sendDealReply(4);

Locked