View Full Version : How do I find certain text...
solarwind
11-07-2006, 01:40 AM
Hi all, as some of you know, I'm working on a tutorial island runner (that will actually work!) During the tutorial, there is a lot of NPC chat going on in the chat box, most of which contains unique words to identify where you are in the tutorial.
Here is a picture:
http://img371.imageshack.us/img371/2116/tutorial1pj1.th.jpg (http://img371.imageshack.us/my.php?image=tutorial1pj1.jpg)
What would be the appropriate function to use to find that text in the bottom text box?
Someone please post a small example of how to find a word (using the font shown in the picture) in the picture.
Also, how would I find and click on a certain item in my inventory?
For example, lets say I had logs and a tinderbox somewhere in my inventory.
What would be the appropriate function to find those logs?
Can someone please create a small example that finds and clicks logs and finds and clicks a tinderbox to make a fire?
IronTeapot
11-07-2006, 04:28 AM
I would use dtm's for the item finding in your inventory. Just do your wood cutting loop for example until(find the log dtm in your inventory). I know you have the problem with your dtm window sizing, so if you choose to go with them, i could make dtms, and send them to you.
YoHoJo
11-07-2006, 04:42 AM
SCAR] dtmLogs:= DTMFromString('78DA639CCAC4C0E0C1C8800A18914820BD0 8A' +
'8C695809A79403551F8D50000BF8402CF');
If FindDTM(x,yLogs,MIX1,MIY1,MIX2,MIy2) then
Mouse(x,y,5,5,true)[/SCAR]
to find where you are in the tut hmm
id use smer long and thin bitmaps to read text
but in madcows he make it a const
const
Location= 1;
1 for begeing
2 for suvival guide
3 for cook
and so on
finding location by NPC talking would be weird and inefficient
and i don't think you are ready to create a tut runner already but i LOVE the enthusiasm cant wait to see your final product!
solarwind
11-07-2006, 05:28 PM
SCAR] dtmLogs:= DTMFromString('78DA639CCAC4C0E0C1C8800A18914820BD0 8A' +
'8C695809A79403551F8D50000BF8402CF');
If FindDTM(x,yLogs,MIX1,MIY1,MIX2,MIy2) then
Mouse(x,y,5,5,true)[/SCAR]
to find where you are in the tut hmm
id use smer long and thin bitmaps to read text
but in madcows he make it a const
const
Location= 1;
1 for begeing
2 for suvival guide
3 for cook
and so on
finding location by NPC talking would be weird and inefficient
and i don't think you are ready to create a tut runner already but i LOVE the enthusiasm cant wait to see your final product!
Actually, I'm not so noob, the tut runner is going quite nicely. And I've found the function:
function FindNpcChatText(txt: String): Boolean;
By: Kernel Klink or Stupid3000, font by Masquerader
Description:
Get last chat message.
That's an tpwnage function. I'm adding specific location within the tutorial with those. It's not too hard, straightforward, but long. So far going nicely. I'd really appreciate if people could create DTMs for all of the inventory items used in the tutorial. So far, the script is pretty efficient and fast. And since there are no [known] randoms on tut island, I don't need to bother with randoms. Also, anti ban is not too much of a problem, because if you get banned, hey just make another, but still, getting flagged is a risk, so I'll implement anti ban later, once the script is stable. I'll post an alpha asap (maybe not a complete one), but something that can get to a certain point without messing up.
Again, I'd really appreciate if people can make DTMs for all the items in the inventory. I'd even pay in RS gp if someone made good working DTMs of all of the inventory items in the tutorial. Just post how much gp you want and make them =).
My DTM editor is messed up (probably because of windoze).
Boreas
11-07-2006, 06:20 PM
Anypick:= DTMFromString('78DA8DCA211600101444D1FF6D168780202 0B' +
'0731329C68437E56A312249E59E1EC5B70F3361323115C611 133E' +
'8C8789C43898414C84E9C45898F5361BA929082D');
used the black outline so it should work all the time
Edit: Don't forget to use more failsafes and self progress checking than usual. If a power chopper/miner/etc gets screwed up it can just reset the cycle, however a tut runner has to go back a step if it misses one.
solarwind
11-07-2006, 07:42 PM
Anypick:= DTMFromString('78DA8DCA211600101444D1FF6D168780202 0B' +
'0731329C68437E56A312249E59E1EC5B70F3361323115C611 133E' +
'8C8789C43898414C84E9C45898F5361BA929082D');
used the black outline so it should work all the time
Edit: Don't forget to use more failsafes and self progress checking than usual. If a power chopper/miner/etc gets screwed up it can just reset the cycle, however a tut runner has to go back a step if it misses one.
Thanks. How would I add more failsafes?
Boreas
11-07-2006, 07:44 PM
Make functinons that know if you did something correctly, or if something has finished yet. Check what I said about loops in your alpha release thread.
IronTeapot
11-07-2006, 08:58 PM
Here are the dtm's for every item used in tut island. ( used with parent and black outline)
All the states of shrimp are the same, so i just made one with max parent tolerance.
AxeDTM := DTMFromString('78DA63DCCBC4C0B08A910119647BB132FC0 7D' +
'220D1FF40C0B803A86603AA1A882C8C04D25B816A7611A1E6 1001' +
'35BB816AB61050731CA8661D013547806A56E2570300883C0 FE5');
TinderBoxDTM := DTMFromString('78DA637CC9C4C0B09B910119B8693133FC0 7D' +
'220D1FF40C00852B30A550D44164602E9CF44A8F90254B383 809A' +
'D740358708A8B90F54B39F809ADB40355B08A8790C54B306B F1A0' +
'0A5EA1287');
NormalLogDTM := DTMFromString('78DA6314626660D8C2C8800C727DD519FE0 36' +
'990E87F2060E401AA598BAA06220B2381B41450CD2A026A14 806A' +
'761050230254B39F801A36A09A7D04D4B062FA0B5D0D0022A 80B7' +
'8');
NetDTM := DTMFromString('78DA63B4616660D8C2C8800C2C0CB418FE0 36' +
'990E87F2060B404AA5985AA06220B2381B40750CD4622D4EC 22A0' +
'C611A8E6200135C64035BB09A83104AAD98C5F0D00893C0C6 0');
ShrimpDTM := DTMFromString('78DA63DCC0C4C070839101199CACE265F80 FA' +
'441A2FF8180713350CD45543510591809A48F01D55C22A0E6 2450' +
'CD1D026AF603D53C23A0663B50CD53FC6A002CF10FF9');//all shrimp states the same
PotDTM := DTMFromString('78DA633462666078C4C8800C16E45A323C0 4D' +
'220D1FF40C0680D547315550D44164602693BA09AC704D498 00D5' +
'BC25A04695087334806AAE115003F2D725FC6A008EA20DC4' );
BucketDTM := DTMFromString('78DA638C61666078C6C8800CE63579323C0 4D' +
'220D1FF40C0980254731D550D44164602E954A09A2704D444 03D5' +
'BC25A02684087382816A6E115003F2D745FC6A0057B40F17' );
BreadDTM := DTMFromString('78DA63BCCFC4C0C006C448607A3127C37F2 0C' +
'D08C4FF8180F10950FE3B23032A60442281F427A09A2F04D4 BC07' +
'D9C3845FCD63A03C270135B781F2FFF0DB050070D70E8F');
DoughDTM := DTMFromString('78DA63B4626660F8C9C8800CFAFBB218FE0 36' +
'990E87F2060B403AAF98CAA06220B2381B42750CD3F543552 5242' +
'A86A6C806A3898F09BA30754F397805D2640355FF0AB01000 7C20' +
'D34');
BronzeBarDTM := DTMFromString('78DA63DCC3C4C02007C448C0445588E13F9 06' +
'604E2FF40C0B80F282F81AA06220B2381F449A0BC3201353B 80F2' +
'DA04D46C00CAAB1250B31D282F8B5F0D007FFD0AB8');
DaggerDTM := DTMFromString('78DA63546266607067624006EDADEC0CFF8 13' +
'42310FF07024665A01A47543510591809A435816ACC09A8D1 03AA' +
'B122A0461DD33D186AA4816A82F0AB0100A51C08AE');
PickAxeDTM := DTMFromString('78DA630C606660B062624006961A220CFF8 13' +
'42310FF070246274C3510591809A47D816ACC09A88906AA71 20A0' +
'C60BA8C69D801A17A09A20026ADC089B0300E6210981');
TinOreDTM := DTMFromString('78DA63AC6266607067624006C519190CAC4 09' +
'A1188FF0301631D508D05AA1A882C8C04D26D4035CE04D4D4 03D5' +
'F81250530C541344404D36508D2301352584DD0C0093680AA 5');//Tolerance of 5
CopperOreDTM := DTMFromString('78DA63AC626660C8646240064762E519588 13' +
'42310FF0702C66AA09A18543510591809A4DB816A5209A8A9 03AA' +
'2924A0A60CA8A68C809A4CA09A0C026A4A08BB190015FF0B9 B');//Tolerance of 5
HammerDTM := DTMFromString('78DA63FCCFC4C0100FC44820C0C383E13F9 06' +
'604E2FF40C0F817281F85AA06220B2381342B330343320135 BF81' +
'F25904D47C02CA971150F385B03900C46B0D4E');
ShortSwordDTM := DTMFromString('78DA635464666028646240067D3D1C0CFF8 13' +
'42310FF070246909A2C543510591809A4D5806A1209A8D103 AA89' +
'22A04605A8A688801A59A09A72026A34806A52F0AB01008B9 F0A3' +
'7');
WoodenShieldDTM := DTMFromString('78DA63F46766604865624006361AFC0CFF8 13' +
'42310FF0702C600A09A68543510591809A463806A9209A809 02AA' +
'2921A0C609A82697801A57A09A24FC6A000E9A09D8');
MindRuneDTM := DTMFromString('78DA636460666098CCC4800CAEE6F130B00 26' +
'94620FE0F048C1C4035BDA86A20B2301248FF04CACF22A0E6 0D50' +
'BE9F809AAF40F906026A9880EE69C4AF0600BF740BAB');//Tolerance of 5
AirRuneDTM := DTMFromString('78DA63546766606867624006B7AF5F67600 5D' +
'28C40FC1F0818D5806AEA51D540646124903602AAE922A046 03A8' +
'661601351240355308A81103AAE9C0AF0600D78E0AD5');//Tolerance of 5
ArrowsDTM := DTMFromString('78DA633463666058C3C4800C02395819FE0 36' +
'94620FE0F048CBA986A20B23012481B01D52C21A0C60EA866 1601' +
'35EE4035F308A8B127C23D1640355B09A8D101AAD9885F0D0 0D03' +
'20C9C');
ShortBowDTM := DTMFromString('78DA634C60666058C6C4800C12C2C2181E0 26' +
'94620FE0F048C194035F350D540646124902E04AA9943404D 1A50' +
'CD0A026AA2816AD61150130254B381809A38A09AA5F8D5000 0370' +
'A0D58');
Test them out, if some don't work, let me know and ill remake it. Enjoy.
EDIT: WOOT! This was my 100th post! :D
YoHoJo
11-07-2006, 09:33 PM
for fialsafes just maek procedure to make sure you did the last task: eg
look for a certin gametab. if its not there then you gota talk to someone again.
things like that =)
and iron. did you put max tol on all of those objects?
you should use max tol for all object except the runes.
IronTeapot
11-07-2006, 10:13 PM
Yes yoho, all have a max tolerance except for the 2 runes, and the ores (to tell if its copper or tin). Here is a dtm that will work with any ore (max tol).
AnyOreDTM := DTMFromString('78DA63AC626660C8646240064762E519FE0 36' +
'94620FE0F048CD5403531A86A20B2301248B703D5A4125053 0754' +
'5348404D19504D1901359940351904D49410763300F4A70C9 5');
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.