Sir R. M8gic1an
2008-03-30 15:36:31
oh so you've heard about TPAs but they sounded too complicated? Got some hope when i said it was simple? Well it is!
You don't need to know much about TPAs to use their power because there is an obscure function in srl called FindObjTPA.
function FindObjTPA(var x, y: integer; color, tol, cts, ObjWidth, ObjHeight, minCount :Integer; UpText: tstringarray): Boolean;
Did that scare you away? i hope not!
i supposed i do not need to explain this part.. "ar x, y: integer; color, tol," it's simple enough. tol stands for tolerance if your not sure.
now comes the part that you might not fully understand.
cts stands for ColorToleranceSpeed. In simple terms it will search for a color in a different way; if you want to know more about cts make sure to check out n3ss3s TPA tut in the advanced section.
otherwise we'll use -1 as cts, because the function will automatically set it for you if you use -1.
"ObjWidth, ObjHeight, minCount" - MinCount is the minimum number of TPoints in a rectangle of ObjWidth and ObjHeight for it to be considered as what you're looking for.
so if we have
ObjWidth = 10
ObjHeight = 10
MinCount = 50
it means that in a square of 10*10 the color you chose has to be in at least 50 pixels for it to be considered as the object. (tol is being used, it does count for this)
Remember that after finding that square it'll move the mouse over it and check for uptext.
"UpText: tstringarray" might be a little complicated. all it means is that you can look for as much text that you want but it has to be in this form:
['UpText1', 'UpText2', 'UpText3', 'UpText4', 'UpText5']
and that's all about using the TPA power without knowing much about them! definitely faster than FindObjCustom!
So how do i use this?
i hope you enjoyed the tut and will now use the TPA power more often!
Feel free to post any questions, rate this thread or rep me. I'll make sure i answer the questions as best as i can.
RM Advice:
–There are many functions in the srl files that are not commonly known about but are extremely useful. Before starting every script make sure you check the srl folders for functions that you might use, especially if it's skill related. Also skim through the SRL folders at every new revision to find new functions that might suit your needs.
~RM
You don't need to know much about TPAs to use their power because there is an obscure function in srl called FindObjTPA.
function FindObjTPA(var x, y: integer; color, tol, cts, ObjWidth, ObjHeight, minCount :Integer; UpText: tstringarray): Boolean;
Did that scare you away? i hope not!
i supposed i do not need to explain this part.. "ar x, y: integer; color, tol," it's simple enough. tol stands for tolerance if your not sure.
now comes the part that you might not fully understand.
cts stands for ColorToleranceSpeed. In simple terms it will search for a color in a different way; if you want to know more about cts make sure to check out n3ss3s TPA tut in the advanced section.
otherwise we'll use -1 as cts, because the function will automatically set it for you if you use -1.
"ObjWidth, ObjHeight, minCount" - MinCount is the minimum number of TPoints in a rectangle of ObjWidth and ObjHeight for it to be considered as what you're looking for.
so if we have
ObjWidth = 10
ObjHeight = 10
MinCount = 50
it means that in a square of 10*10 the color you chose has to be in at least 50 pixels for it to be considered as the object. (tol is being used, it does count for this)
Remember that after finding that square it'll move the mouse over it and check for uptext.
"UpText: tstringarray" might be a little complicated. all it means is that you can look for as much text that you want but it has to be in this form:
['UpText1', 'UpText2', 'UpText3', 'UpText4', 'UpText5']
and that's all about using the TPA power without knowing much about them! definitely faster than FindObjCustom!
So how do i use this?
FindObjCustom(x, y, ['Willow'], [2772296, 124356, 000000], 11);
//change to ...
if FindObjTPA(x, y, 2772296, 11, -1, 7, 7, 15, ['Willow']) then
// simple fast and easy!
i hope you enjoyed the tut and will now use the TPA power more often!
Feel free to post any questions, rate this thread or rep me. I'll make sure i answer the questions as best as i can.
RM Advice:
–There are many functions in the srl files that are not commonly known about but are extremely useful. Before starting every script make sure you check the srl folders for functions that you might use, especially if it's skill related. Also skim through the SRL folders at every new revision to find new functions that might suit your needs.
~RM