View Full Version : ChooseOption Popup...
Jason2gs
03-19-2007, 10:37 PM
One problem I have, is misclicking the "ChooseOption" button. If the ChooseOption misses the NPC, it'll just click "Cancel" and register that as if it did, then it just goes on with the rest of the procedure/script.
I saw somewhere where someone has ChooseOption setup like this"
if(ChooseOption(x, y, 'Text'))then
Will that work? It'll check to see what it's clicking, right?
What happens if it doesn't click 'Text'? I remember seeing something about "Popup" too... What does Popup(...) do?
ilikegrapesoda72
03-20-2007, 12:49 AM
I am a SRL nubkin, and I'm not to sure what you mean... Maybe try a repeat of procedure until(line=true) kind of thing?
Smartzkid
03-20-2007, 01:08 AM
Try adjusting the ChooseOption procedure?
I'd try it, but I'm tried and I've got tests tomorrow...
whales
03-20-2007, 01:28 AM
I changed the choose option function to find a bitmap of the text and click that, it works very well. I'll post if it applies to what your talking a bout.
gsquare567
03-20-2007, 01:37 PM
oh please post it i've been trying to make a working one but i suck at bitmaps. also, can you tell me how you made it better? because it already looks for a bitmap of the text.
Jason2gs
03-20-2007, 05:20 PM
That's not exactly what I'm looking for.
The problem I have with ChooseOption, is that if, in the time it takes SCAR to check the uptext, then to right click to talk, it misses, it'll click cancel and register that as clicking "Talk". Then it'll go on with the rest of the scrpit. I need a failsafe. ;)
WT-Fakawi
03-20-2007, 05:25 PM
ChooseOption returns false if the text was missed ('cancel'), so there is your failsafe :)
Reduce the UpText to its bare minimun. If you are looking for Guards f.i. use IsUpText('ua'). Also, if you are sure about the place you are standing and there is only one NPC around, you might also check for the Yellow Color in the UpperCorner (So dont check for text, but for color)
Markus
03-20-2007, 05:29 PM
you mean something like this?
repeat
if (findyournpcstuffhere) then
begin
DoHereAnythingWoithoutPopup
end;
until(PopUp('alk'));
Jason2gs
03-20-2007, 05:34 PM
ChooseOption returns false if the text was missed ('cancel'), so there is your failsafe :)
Reduce the UpText to its bare minimun. If you are looking for Guards f.i. use IsUpText('ua'). Also, if you are sure about the place you are standing and there is only one NPC around, you might also check for the Yellow Color in the UpperCorner (So dont check for text, but for color)
1. How would you set that up? if(Not(ChooseOption(x, y, 'Talk')))then like that?
2. I can have it check for just the color of the uptext? How would I set that up?
you mean something like this?
repeat
if (findyournpcstuffhere) then
begin
DoHereAnythingWoithoutPopup
end;
until(PopUp('alk'));
That would work :)
But what's the difference between PopUp and ChooseOption?
WT-Fakawi
03-20-2007, 05:43 PM
1. Correct. If not ChooseOption then begin dowhateverneededlikechooseoptionagain end;
2. Correct too. Just the Color. If FindColorTolerance(Yellow Color, UpperLeftBoundaries) BINGO!
To be on the safe side, you could do first scan for the color, and then for the text, thus eliminating the constant createbitmapmaskfromtext- business needed for IsUpText.
Jason2gs
03-20-2007, 05:50 PM
Ahh, I thought searching for the color would be another option of IsUpText. The way you made it sound, it kinda did :p
I've always wondered what would happen if, for some reason, someone was standing in the perfect, position, so that their text was in the area of the uptext. Could they possibly screw with your script?
Edit: Oh, but still, what's Popup do? I've seen:
if(Not(ChooseOption(...)))then
Popup(...);
Before, but I'm still not sure what it does.
WT-Fakawi
03-20-2007, 05:58 PM
Popup's the same as ChooseOption. ChooseOption is made by stupid3ooo and Popup by RsN. Use whichever fits your computers need.
EDIT:
You could do:
for x:=1 to 10
begin
If ChooseOption then break;
end;
It will try ChooseOption now ten times and break when succeeded.
Jason2gs
03-20-2007, 08:28 PM
I've never used the for...to tag before. Now that I know how it works, I'll probably be using it quite a lot :)
Thanks, mate. You've been a big help ;)
Smartzkid
03-20-2007, 08:53 PM
I've never used the for...to tag before. Now that I know how it works, I'll probably be using it quite a lot :)
Thanks, mate. You've been a big help ;)
=O You never learned how to use the for loop?!??!
:p That was the first loop I learned how to use
I think I'm gonna have some serious revising to do on my powerchopper; from what Fakawi has shown us, I could make it waaay more efficient
gsquare567
03-22-2007, 03:46 AM
Popup's the same as ChooseOption. ChooseOption is made by stupid3ooo and Popup by RsN. Use whichever fits your computers need.
EDIT:
You could do:
for x:=1 to 10
begin
If ChooseOption then break;
end;
It will try ChooseOption now ten times and break when succeeded.
for that matter, screw the x!
for 1 to 10
begin
If ChooseOption then break;
end;
lol
but i have my own problem. it works 90% of the time, but the odd time it examines instead of takes. im gonna try to modify my chooseoption to look for the first occurance of the 'Examine' bitmap and only look above that. it will take more time to check that way, but in my case it will be more efficient that clicking examine 50x =) and less detectable. i'll post it here wen im done, shouldnt take long but i'll do it 2morrow cuz im tired.
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.