Page 1 of 1

Error when I launch minigames

Posted: Sun Feb 24, 2013 8:05 am
by lolilol
Hi,


I use two computers, when I want launch micromacro for my mini games on one on them, it's said that it's successfully open dialogue but it is false. Nothing is open.
There is a screenshot enclose with the error .


Thx for help,

Best regards,

Re: Error when I launch minigames

Posted: Sun Feb 24, 2013 9:24 am
by rock5
Do you still have the QuestByName userfunctions installed? If so remove it.

Re: Error when I launch minigames

Posted: Sun Feb 24, 2013 12:02 pm
by lolilol
No, i Don't have this userfunction.

Re: Error when I launch minigames

Posted: Sun Feb 24, 2013 12:39 pm
by rock5
Then it might be because StaticPopup1 is nil. It should be checked if ShowStaic1 exists before trying to use that command. It looks like party.lua is the only place in the bot where that is used and it doesn't check, unless it's from a userfunction or waypoint file.

I'm looking at party.lua and I'm not sure what popup it is expecting but we could probably do this the easy way. Do this. In party.lua at around line 346 change this

Code: Select all

					sendMacro('StaticPopup_OnClick(StaticPopup1, 1);')
to this

Code: Select all

					sendMacro('} if StaticPopup1 then StaticPopup_OnClick(StaticPopup1, 1) end a={')

Re: Error when I launch minigames

Posted: Sun Feb 24, 2013 1:12 pm
by lolilol
Thx for your help.
I''ll post results tommorow :)

Re: Error when I launch minigames

Posted: Sun Feb 24, 2013 6:17 pm
by lisa
rock5 wrote:I'm looking at party.lua and I'm not sure what popup it is expecting
That is purely for travelling using NPC's like Snoop, you get partyleader to target a NPC and then do this in party chat

Code: Select all

npc"silverspring"
it will target your target and then travel to silverspring, so the static popup is to accept the traveling option.
I guess people might use the same command for other things besides traveling, so the check for staticpopup is probably a good idea to allow for that.

Since the path being used in the image isn't a party WP then I doubt it has anything to do with using partychat monitoring.

Re: Error when I launch minigames

Posted: Sun Feb 24, 2013 11:02 pm
by rock5
lisa wrote:That is purely for travelling using NPC's like Snoop, you get partyleader to target a NPC and then do this in party chat
That's what I thought but I saw that 'npc' was for talking to npcs and the argument is to select the option so I figured it could be used for any choosing of npc options. So maybe the staticpopup could also be for any other static popup that might open besides when traveling via snoop. But even when using it for traveling you wont always get a popup if there is no cost. Yeah, so, I just didn't want to assume. Personally I don't do blind accepts of popups anymore, especially when teleporting via snoop because there are people that hang around teleports and ask for duels just as you are arriving at the snoop and you end up accepting the duel. :(
lisa wrote:Since the path being used in the image isn't a party WP then I doubt it has anything to do with using partychat monitoring.
Ah, yes. I should have seen that. I guess he can apply my fix to his wp file then.

Answering popups properly can be confusing. I wonder if I should make a function for answering popups.

Re: Error when I launch minigames

Posted: Mon Feb 25, 2013 1:53 am
by rock5
Maybe something like this

Code: Select all

function AcceptPopup(popupName)
	-- Get the correct popup frame
	local popup
	if popupName == nil then -- look for first visible popup
		for i = 1,4 do
			if RoMScript("StaticPopup"..i..":IsVisible()") then
				popup = "StaticPopup"..i
				break
			end
		end
	else -- look for the named popup
		popup = RoMScript("StaticPopup_Visible('"..popupName.."')")
	end

	-- Accept the popup
	if popup then
		print("Accepting popup "..RoMScript(popup..".which"))
		RoMScript("StaticPopup_EnterPressed("..popup..");") yrest(1000)
		RoMScript(popup..":Hide()")
	else
		print("Popup not found "..(popupName or ""))
	end
end
AcceptPopup() -- Accepts first available popup. Prints the name of the popup being accepted.
AcceptPopup(popupname) -- Accepts only the popup specified ignoring other popups.

Re: Error when I launch minigames

Posted: Mon Feb 25, 2013 5:06 pm
by lolilol
Well,


this line : sendMacro('} if StaticPopup1 then StaticPopup_OnClick(StaticPopup1, 1) end a={')
doesn't works.
Your function AcceptPopup(popupName) is a userfunction? or Ingamefunction?
thx fou your help :)

Tommorow I will check this function .

Re: Error when I launch minigames

Posted: Mon Feb 25, 2013 10:52 pm
by rock5
lolilol wrote:this line : sendMacro('} if StaticPopup1 then StaticPopup_OnClick(StaticPopup1, 1) end a={')
doesn't works.
Oops. It's supposed to be

Code: Select all

sendMacro('} if StaticPopup1:IsVisible() then StaticPopup_OnClick(StaticPopup1, 1) end a={')
lolilol wrote:Your function AcceptPopup(popupName) is a userfunction? or Ingamefunction?
Well, it's a bot function. You could make it into a userfunction but I was considering adding it to the bot.

Re: Error when I launch minigames

Posted: Fri Mar 08, 2013 10:17 am
by rock5
AcceptPopup has been added to rev 754.