Cstrike
2010-12-06 15:22:37
R_ChooseOptionDual
For the lack of a better name…
{*******************************************************************************
function R_ChooseOptionDual(AboveOptionFragment, BelowOptionFragment: String; ChooseAboveOption: Boolean): Boolean;
By: Cstrike, copied mainly from Drags111
Description: Checks for two paired text that should be next to each other.
Useful for fishing when you have Net/Harpoon versus Cage/Harpoon and you are
trying to 'harpoon'. If the texts aren't next to each other, will return false.
ChooseTopOption = true means it will choose AboveOption, false = BelowOption.
*******************************************************************************}One problem that really irritated me in the fishing guild is that occasionally the lobster/sword spot would be next to or on the net/harpoon spot, meaning that you'd have to failsafe it from catching the other stuff, and this could only be done *after* the fact, and might not even prevent it from happening that much since if you want to fish sharks… 'harpoon' will appear on each fishing spot.
Sure, you could make your mouse randomness to zero and hit the dead center, if you want to be banned… but no need, this function now does it all for you!
Note that it only searches for a fragment of the text, so be specific in what you're looking for. If it says 'Harpoon Fishing spot', put something like 'Harpoon Fi' because it uses the Pos(); function
Bonuses for using:
- Does the same thing as R_ChooseOptionMulti almost, except it passes this new parameter to ensure you're hitting the right option.
- Now human names won't affect your option choosing, if some guy has the name 'harpoon' in his name, you won't accidentally pick him
- For the same reason above, bot hunters now won't stop you :sasmokin:
How it works
R_ChooseOptionDual(AboveOptionFragment, BelowOptionFragment: String; ChooseAboveOption: Boolean)
If you have a menu text like this:
Trade with NoobFace121 (level-64)
Cage Fishing spot
Harpoon Fishing spot
Net Fishing spot
Harpoon Fishing spot <----
Walk Here
CancelIf you want to target the area I pointed to above, do this:
R_ChooseOptionDual('Net Fishing', 'Harpoon Fishing', False);We set the last option as False because we don't want it to choose the above fragment.===========================================
If you get this:
Trade with NoobFace121 (level-64)
Net Fishing spot
Harpoon Fishing spot
Cage Fishing spot <----
Harpoon Fishing spot
Walk Here
CancelUse
R_ChooseOptionDual('Cage Fis', 'Harpoon Fis', True);To select the top spot.===========================================
If you get this:
Trade with NoobFace121 (level-64)
Cage Fishing spot <----
Harpoon Fishing spot
Net Fishing spot
Harpoon Fishing spot
Walk Here
CancelYou can use either R_ChooseOptionDual or R_ChooseOption[Multi] if you want, as either will work. But of course, it won't always end up this pretty.
This function should be used when you need to select a specific action relative to another one.
More to come :)
If you have any problems with it post
Yes, this may hint towards what is in the works… ;)
If you have any problems with this, post here. Thank you