SRL Archive - MSI Suggestions

Chat Reaction


Sir R. M8gic1an

2011-04-24 07:08:51

MSI currently doesn't react to

'There is no ore currently available in this rock'

obviously this would be a useful thing to react to :p

VEM is currently PACKED with bots.

~RM

Home

2011-04-24 07:20:04

With reflection it's pretty easy to check ID's (Do ID currently exist).

But for color:
I would add that Text check, and color check. (Do Colors exists, or countcolor)


~Home

Gu3st...

2011-04-24 07:21:51

IIRC, ID doesn't change even if there's no ore left

HarryJames

2011-04-24 07:24:21

Zyt3x, I think the rock ID does change everytime it's mined. That's how it works with three's, and I don't see why it would be different. They must do, cause it changes colour, unless they just did it that way.

Home

2011-04-24 07:25:19

From: Zyt3x
IIRC, ID doesn't change even if there's no ore left


Sorry, my bad. But you could do this.


FindRsObjectSimple ---> SortTPAFrom ---- > If CurrentRock <> NewRock then Exit;
Those Results Tile Position.

EDIT: So my points is, that Tiles positions do change.
Ofc, when new rock is avaible more near than yours currently.

~Home

Echo_

2011-04-24 10:08:31

You could use:

FindBlackChatMessage('There is no ore currently available in this rock');

NCDS

2011-04-24 10:23:05

From: Echo_
You could use:

FindBlackChatMessage('There is no ore currently available in this rock');


A variation of this will be added. We don't use Reflection for Objects, only walking.

Coh3n

2011-04-24 11:03:01

This happens to you in VEM? I thought it was only Coal that this happened with because the colors are so close. I agree that something should be added, but you shouldn't get the message to begin with, and even when you get that message it should move on because there's no colors on the rock you clicked before.

Floor66

2011-04-24 11:34:32

From: Zyt3x
IIRC, ID doesn't change even if there's no ore left


Last time I checked it did ;)

NCDS

2011-04-24 11:44:40

From: Coh3n
This happens to you in VEM? I thought it was only Coal that this happened with because the colors are so close. I agree that something should be added, but you shouldn't get the message to begin with, and even when you get that message it should move on because there's no colors on the rock you clicked before.

Certainly something to look into, but hopefully just adding an extra check for the text will resolve any issues. Most likely the rock is just being mined between the time it is found and clicked.

Also, let me know when your home, I'm almost done! :)

Coh3n

2011-04-24 11:48:31

From: NCDS
Certainly something to look into, but hopefully just adding an extra check for the text will resolve any issues. Most likely the rock is just being mined between the time it is found and clicked.

Also, let me know when your home, I'm almost done! :)

I'm home now for a little bit. I've actually been working on cooking for the last hour or so and I really, really hope you checked by branch because I did make quite a few updates. Get on MSN.

Gu3st...

2011-04-24 16:01:52

From: Floor66
Last time I checked it did ;)
Ah, then I'm wrong. I haven't checked myself, I just remember reading it here on the forum somewhere

Coh3n

2011-07-21 09:37:40

Was just thinking, how exactly would checking for this text work? I mean, it clicks the rock, then the message shows up. So we've found the message, great! What now? Mark the box we just clicked as a bad box so we don't click it again? What about when the more comes back?

Yago

2011-07-27 21:47:25

From: Coh3n
Was just thinking, how exactly would checking for this text work? I mean, it clicks the rock, then the message shows up. So we've found the message, great! What now? Mark the box we just clicked as a bad box so we don't click it again? What about when the more comes back?


Ill see if I can work on this a bit… I need to get my characters mining lvls up anyways.

Troll

2011-07-28 03:14:22

From: Coh3n
Was just thinking, how exactly would checking for this text work? I mean, it clicks the rock, then the message shows up. So we've found the message, great! What now? Mark the box we just clicked as a bad box so we don't click it again? What about when the more comes back?


But also if its still the last text in the chat box you would get a flase postive when you click a new rock.

litoris

2011-07-28 03:16:05

Just make it so that if the text appears, the character moves on to the next rock. This will create a "You swing your pickaxe" message, allowing for a new "no ore" message to be seen, while allowing the char to mine a rock with ore.

Troll

2011-07-28 03:59:13

From: litoris
Just make it so that if the text appears, the character moves on to the next rock. This will create a "You swing your pickaxe" message, allowing for a new "no ore" message to be seen, while allowing the char to mine a rock with ore.


Oh :p shows how much i play runescape

:duh:

Coh3n

2011-07-28 10:10:55

From: litoris
Just make it so that if the text appears, the character moves on to the next rock. This will create a "You swing your pickaxe" message, allowing for a new "no ore" message to be seen, while allowing the char to mine a rock with ore.
I was unaware/didn't notice that either. I still don't know if it would work properly because if the "no ore" message appears we'd skip that rock, but then the same message will be there before you click the next one so it would think it happened again. I think it's a matter of finding the right place to call the function.

Yago

2011-07-28 11:50:57

From: Coh3n
I was unaware/didn't notice that either. I still don't know if it would work properly because if the "no ore" message appears we'd skip that rock, but then the same message will be there before you click the next one so it would think it happened again. I think it's a matter of finding the right place to call the function.


wait how do you get the "You swing your pickaxe" message?

Coh3n

2011-07-28 19:42:15


if (getBlackChatMessage() = 'swing') then
May have to modify 'swing' to get it to work properly.

{*******************************************************************************
function GetBlackChatMessage: String;
By: Wizzup?
Description: Gets text with color 0 in last chat line.
*******************************************************************************}
function GetBlackChatMessage: string;
begin
Result := GetChatBoxText(8, clMessage);
end;

Yago

2011-07-29 14:20:10

No like how do you replicate it? How does it happen on RS?

Coh3n

2011-07-29 14:36:17

From: Yago
No like how do you replicate it? How does it happen on RS?
When you start mining a rock I think.

Yago

2011-07-31 18:42:58

I have the function already structured in my head, but its accurate enough only to be used as a failsafe.

Before i do anything i need to talk to u coh3n on irc or something.

Coh3n

2011-08-01 14:38:12

Post your concerns here or PM me until you can get a hold of me on IRC.

Yago

2011-08-01 16:17:07

Ok. How does MSI check if a rock has gone away?

Coh3n

2011-08-01 18:45:32

From: Yago
Ok. How does MSI check if a rock has gone away?
Check out MSI_WaitWhileMining in Mining.simba. It uses the object tracking system + a few other failsafes.

Yago

2011-08-01 20:07:39

Is saw this:

if FindChatBoxText('manage to mine', 8, clMessage) then
begin
MSI_Debug('Found Text');
Break;
end;

now in my head I was thinking of a complex procedure, but can't we add another line like this?

edit: nvm cause we run into the problem of multiple of those lines…

edit2: how do we confirm we are currently mining? I thought it had something to do with animations. I see we confirm it with a didredclick in findobjects… Is this true?

Coh3n

2011-08-01 22:56:26

From: Yago
edit2: how do we confirm we are currently mining? I thought it had something to do with animations. I see we confirm it with a didredclick in findobjects… Is this true?
That's how MSI_FindObjects returns true (i.e. when the rock is clicked). Animations aren't used for mining, it's just object tracking (looks for the colors of the rock being mined), plus some other failsafes (I can't think of right now).

I still don't think this would work properly for reasons said on the last page.

Yago

2011-08-02 13:03:24

From: Coh3n
I still don't think this would work properly for reasons said on the last page.


Thats why it would be a failsafe if it get accepted but enough talk… I need to get to work.

Coh3n

2011-08-02 13:05:19

From: Yago
Thats why it would be a failsafe if it get accepted but enough talk… I need to get to work.
Yeah but what do you plan on doing when the text is found? I suppose it could be called in MSI_FindObjects and just continue with the loop, but then you again run into the issue of false positives.

Yago

2011-08-02 13:15:48

From: Coh3n
Yeah but what do you plan on doing when the text is found? I suppose it could be called in MSI_FindObjects and just continue with the loop, but then you again run into the issue of false positives.


You create a global tstring array set its length to 8 or how ever many messages thenchatbcan hold and the you update it based on new messages. If all 8 lines are full of flase positives then it returns false, otherwise you could be able to check by comparing the chat box with the array

Coh3n

2011-08-02 13:29:43

From: Yago
You create a global tstring array set its length to 8 or how ever many messages thenchatbcan hold and the you update it based on new messages. If all 8 lines are full of flase positives then it returns false, otherwise you could be able to check by comparing the chat box with the array
I'll try to explain better. Let's look at an example.

There are 2 rocks on the main screen, coalA and coalB; coalA doesn't have any ore in it, while coalB does. Since the ore's colours are so similar to the rock itself, it still finds the empty rock (coalA) as a "minable" rock. So it clicks rockA, and the "There is no ore" message appears. Okay sweet, the message appeared and the script has found it, now what? Continue on with the next rock? You could, but the same thing would happen because the message is still in the chat box, thus creating an endless cycle until a different message appears.

Here's what I think may work:
  • Edit MSI_MineRock (Mining.simba) to check the LAST line of chat text.
  • If "There is no ore" message is found, then wait a couple seconds for the "You swing your pickaxe" message.
  • If the latter text doesn't appear after 1-2 seconds, exit the function.
  • Something like this:

  • function MSI_MineRock(which: TIntegerArray; var forceFail: Boolean): boolean;
    var
    rockObjs: TMSObjectArray;
    rock: TMSObject;
    begin
    if (not loggedIn) then
    exit;

    rockObjs := MSI_GetObjects(which);

    if (MSI_FindObjects(rockObjs, moLeft, rock)) then
    begin
    result := true;

    if (findText('no ore available')) then
    if (not waitFindText('swing pickaxe')) then
    exit;

    MSI_WaitWhileMining(rock);
    end else
    result := MSI_FindRandoms(false);
    end;
    Keep in mind that findText and waitFindText probably aren't the right functions to be using, they're just for the sake of the example.
Usually keeping things simple is the best way. ;)

Yago

2011-08-02 14:16:58

Im at work rightso im mobile now

but i was thinking of something more complex. Load all you swing and no ore messages into an array. When the function is called it compares previous messages to current ones. So there would only be a problem if peple were talking alot or if all messages were the same like no ore repeatedly and in that case it would return false

Coh3n

2011-08-02 14:47:25

From: Yago
Im at work rightso im mobile now

but i was thinking of something more complex. Load all you swing and no ore messages into an array. When the function is called it compares previous messages to current ones. So there would only be a problem if peple were talking alot or if all messages were the same like no ore repeatedly and in that case it would return false
Something that complex isn't really necessary in my opinion. What I said should work, just fine, but feel free to prove me wrong. :p

Yago

2011-08-02 14:54:02

From: Coh3n
Something that complex isn't really necessary in my opinion. What I said should work, just fine, but feel free to prove me wrong. :p


Im sure yours isnt specific and is seudo code but then hownwould you handle false positives?

Coh3n

2011-08-02 16:39:06

From: Yago
Im sure yours isnt specific and is seudo code but then hownwould you handle false positives?
You could mark the point clicked as a bad box so it would move on to the next one. That should work.

Yago

2011-08-03 11:30:51

From: Coh3n
You could mark the point clicked as a bad box so it would move on to the next one. That should work.


That would work then.