Log in

View Full Version : Older Uptext



Jenga
07-22-2012, 10:03 AM
Hi, I'm currently working on a Woodcutting script for the Soulsplit RSPS with the help of a few of YoHoJo's video's. Anyway what I'm stuck with is the uptext not being recognised, it worked fine when I followed his DTM tutorial, but doesn't seem to work when I follow his Woodcutting tutorial. From what I've read, I need an older version of the uptext (apparently a 2010 will work) but I have no idea where to find it, how to change it or where to start. If someone could post a link to a guide (apparently they exist) or even tell me how to do it, I'd appreciate it greatly.

Caotom
07-22-2012, 10:05 AM
It don't believe that you can downgrade to an older font but try following this tutorial http://villavu.com/forum/showthread.php?t=60451 and using a function like FindText or FindTextEx To locate your font.

~Caotom

Jenga
07-22-2012, 10:19 AM
It don't believe that you can downgrade to an older font but try following this tutorial http://villavu.com/forum/showthread.php?t=60451 and using a function like FindText or FindTextEx To locate your font.

~Caotom

Thanks for the quick reply! I'll post back with a result.

Jenga
07-22-2012, 03:37 PM
Sorry if I've posted too early and this is considered spam, but I was able to create my own custom uptext to an extent, and I'm still a little clueless on how exactly I'd bring that into my script. I'm assuming it doesn't happen automatically, or I've done something very wrong.

If someone could give me an example of how to call a custom UpText as well as explain what actually happens it'd really help.

Main
07-22-2012, 03:46 PM
you don't need to create new ocr. Just use findcolors and length of that tpa. For example, the "Cut Tree" is blue and there the length of that tpa might be 80, where as "Walk to player" is different color with length of 130.

Jenga
07-22-2012, 03:49 PM
you don't need to create new ocr. Just use findcolors and length of that tpa. For example, the "Cut Tree" is blue and there the length of that tpa might be 80, where as "Walk to player" is different color with length of 130.

You wouldn't know of any tutorials/guides that might make doing what you just described a little easier? I've (as far as I know) torn the forums apart trying to find some sort of a guide but I can't find it for the life of me.

Sorry for being so dependent.

Edit: In hindsight I've been able to find something.

Thanks for pointing me in the right direction!

Edit: In double hindsight, if I was to write multiple scripts for this server (once I'd gotten the hang of it), wouldn't it be better for me to have a Custom Uptext written?

CowFish
07-22-2012, 10:54 PM
I'm working on writing scripts for private servers too. I might work on creating a custom font and I'll let you know if I can ever get it done :P

P1ng
07-22-2012, 10:58 PM
Edit: In double hindsight, if I was to write multiple scripts for this server (once I'd gotten the hang of it), wouldn't it be better for me to have a Custom Uptext written?

If you have found a method that works and is fool-proof then really there is no reason why you should need to create a 'Custom Uptext'. If finding the colour and it's length is working for you then I'd probably just stick with that to be honest.

Jenga
07-23-2012, 03:37 AM
If you have found a method that works and is fool-proof then really there is no reason why you should need to create a 'Custom Uptext'. If finding the colour and it's length is working for you then I'd probably just stick with that to be honest.

How do I acquire the objects length? I'm obviously new to this so any tutorials you can link me are appreciated. I've read a little on TPA's but I'm not sure if that's the path I should be going down.

zluo
07-23-2012, 03:42 AM
How do I acquire the objects length? I'm obviously new to this so any tutorials you can link me are appreciated. I've read a little on TPA's but I'm not sure if that's the path I should be going down.

older uptext, simba > fonts > uptextex (i have tested this and it WORKS for soulsplit, but i have personally never used it for all my soulsplit scripts, i find my method following fool proof). ive made a soulsplit chopper (17 hours proggies :D) and i just simply use a dtm of the trees, and when i right click it, i check if the text reads "chop tree" otherwise itll exit and retry.

Jenga
07-23-2012, 04:09 AM
older uptext, simba > fonts > uptextex (i have tested this and it WORKS for soulsplit, but i have personally never used it for all my soulsplit scripts, i find my method following fool proof). ive made a soulsplit chopper (17 hours proggies :D) and i just simply use a dtm of the trees, and when i right click it, i check if the text reads "chop tree" otherwise itll exit and retry.

Yeah, I was thinking of using DTM's but I wasn't sure about the usability. How would I go about inserting that older uptext into my script?

Edit: I've decided to use DTM's, is there a way to set an angle? I've attempted to use MakeCompass but it just sends my camera in circles. Any ideas?

P1ng
07-23-2012, 05:45 AM
Zluo said that the font UpTextEx will work for RSPS SoulSplit. I can neither confirm nor deny this, but if you are going to implement that method then this is roughly how you would go about it.

function to use -
FindText(var cx, cy: Integer; txt,font: string; xs, ys, xe, ye: Integer): Boolean;

variables explained -
cx - where it will store the x-coordinate if string is found
cy -where it will store the y-coordinate if string is found
txt - text to search for
font - what font to search for the text in
xs - start x-coordinate to search in
ys - start y-coordinate to search in
xe - end x-coordinate to search in
ye - en y-coordinate to search in

example use -
procedure ChopTree;
var
x,y:integer;
begin
if FindTree then
begin
if FindText(x, y, 'hop', 'UpTextEx', 0, 0, w-1, h-1) then
ClickMouse2(mouse_Left) else
WriteLn('Incorrect UpText @ChopTree');
end else
WriteLn('Didn''t FindTree @ChopTree');
end;

Now this is purely an example, I do not know what your procedure looks like or anything like this so I'm not sure how you are implementing it but this is a quick run down of this procedure here.
If the script finds a tree using whatever method it is you are using it will check for the UpText.
If it finds the Text 'hop' anywhere within the top-left corner of the client and 1px in from the bottom right corner of the client the script will do a left click at it's current mouse position.
You will need to implement that uptext with changes to the text and changes to the co-ordinates it searches within specific to your own script.

Hazzah
07-23-2012, 06:55 AM
Zluo said that the font UpTextEx will work for RSPS SoulSplit. I can neither confirm nor deny this, but if you are going to implement that method then this is roughly how you would go about it.

function to use -
FindText(var cx, cy: Integer; txt,font: string; xs, ys, xe, ye: Integer): Boolean;

variables explained -
cx - where it will store the x-coordinate if string is found
cy -where it will store the y-coordinate if string is found
txt - text to search for
font - what font to search for the text in
xs - start x-coordinate to search in
ys - start y-coordinate to search in
xe - end x-coordinate to search in
ye - en y-coordinate to search in

example use -
procedure ChopTree;
var
x,y:integer;
begin
if FindTree then
begin
if FindText(x, y, 'hop', 'UpTextEx', 0, 0, w-1, h-1) then
ClickMouse2(mouse_Left) else
WriteLn('Incorrect UpText @ChopTree');
end else
WriteLn('Didn''t FindTree @ChopTree');
end;

Now this is purely an example, I do not know what your procedure looks like or anything like this so I'm not sure how you are implementing it but this is a quick run down of this procedure here.
If the script finds a tree using whatever method it is you are using it will check for the UpText.
If it finds the Text 'hop' anywhere within the top-left corner of the client and 1px in from the bottom right corner of the client the script will do a left click at it's current mouse position.
You will need to implement that uptext with changes to the text and changes to the co-ordinates it searches within specific to your own script.

Wow, that is probably one of the most informative posts I have ever seen.

+Repped

Jenga
07-23-2012, 07:15 AM
Zluo said that the font UpTextEx will work for RSPS SoulSplit. I can neither confirm nor deny this, but if you are going to implement that method then this is roughly how you would go about it.

function to use -
FindText(var cx, cy: Integer; txt,font: string; xs, ys, xe, ye: Integer): Boolean;

variables explained -
cx - where it will store the x-coordinate if string is found
cy -where it will store the y-coordinate if string is found
txt - text to search for
font - what font to search for the text in
xs - start x-coordinate to search in
ys - start y-coordinate to search in
xe - end x-coordinate to search in
ye - en y-coordinate to search in

example use -
procedure ChopTree;
var
x,y:integer;
begin
if FindTree then
begin
if FindText(x, y, 'hop', 'UpTextEx', 0, 0, w-1, h-1) then
ClickMouse2(mouse_Left) else
WriteLn('Incorrect UpText @ChopTree');
end else
WriteLn('Didn''t FindTree @ChopTree');
end;

Now this is purely an example, I do not know what your procedure looks like or anything like this so I'm not sure how you are implementing it but this is a quick run down of this procedure here.
If the script finds a tree using whatever method it is you are using it will check for the UpText.
If it finds the Text 'hop' anywhere within the top-left corner of the client and 1px in from the bottom right corner of the client the script will do a left click at it's current mouse position.
You will need to implement that uptext with changes to the text and changes to the co-ordinates it searches within specific to your own script.

The Mesiah!

I'm assuming that "UpTextEx" (isn't being recognized) is the same as 'UpCharsEx'? Excuse my ignorance.

Also, could you suggest a function to find the color, that will work with that FindText command? I'm currently trying to use FindColorSpiral, but to no avail.

P1ng
07-23-2012, 08:13 AM
I'm assuming that "UpTextEx" (isn't being recognized) is the same as 'UpCharsEx'? Excuse my ignorance.

Also, could you suggest a function to find the color, that will work with that FindText command?
Potentially, yes. Although given the fact I have never made an in-depth script for a privately server or specifically for SoulSplit, I couldn't tell you if that font will, in fact work. You could make up a dummy procedure that can test for you whether or not it reads the UpText correctly.

If it does not you could then continue on through testing with all the fonts found in your Simba folder. Following on from that I know there is a tutorial on these forums somewhere that teaches you how to create your own font set for Simba if none of the pre-loaded ones work. From there you can go on to use the procedure similar to the one I outlined for you previously.

In response to the finding color query, I would suggest using TPAs however these are a little bit more advanced than a simple FindColor and all of the tutorials that can be found on here are daunting big blocks of text in relation to TPA.

If you would like you can PM me and I can attempt to run you through the absolute basics of creating a TPA function for finding a particular colour/object. Alternatively you can trawl through the tutorials and learn how to make one yourself :)

PS- Thank-you for the +rep.

zluo
07-23-2012, 08:13 AM
http://www.youtube.com/watch?v=98wVrr6GwyU
it would be certianly useful to detect trees. however since theyre quite similar to the ground color and are spotted, you could always make a small bitmap of them and that would also work

Jenga
07-23-2012, 06:47 PM
Thanks for the help everyone! Just thought I'd let you know that I've got tears of joy in my eyes because I've just managed to write the part of the script that drops the logs. Little steps.

How would I make simba know that the inventory is full and it's time to drop the Logs? I assume it's a repeat until sort of thing, but repeat until what?

Oh, I'm using DTM's of the logs, seeing as that's probably going to be relevant.

Also forgive me for asking another question. I'm unaware to the etiquette regarding this, as it is on a different topic.

CowFish
07-24-2012, 01:58 AM
you should be able to use the invfull function, it works for me on private servers...
ex.


Repeat
ChopLogs;
Until (InvFull);