SRL Archive - MSI Suggestions

Force call MSI_FindRandoms


nickrules

2010-11-18 17:54:34

I don't have much time at all, some im going to make this quick.
What If we could force call MSI_FindRandoms using the player-remote or some other interface of that nature. Would be useful, as sometimes MSI gets stuck in a loop of searching for objects and doesn't search for randoms.

Eg, I logged out of an account in the quiz random which wasn't detected because it was trying to find an object. when it auto-logged back in, it found the random and solved it.

Discuss.

Naike

2010-11-18 18:41:50

Just want to point out that MSI doesn't use reflection randoms anymore.

SetupReflection was changed so you wasn't forced to use them, when they're not in BETA I'll let you know :)

NCDS

2010-11-18 18:43:45

From: Naike
Just want to point out that MSI doesn't use reflection randoms anymore.

SetupReflection was changed so you wasn't forced to use them, when they're not in BETA I'll let you know :)


I already had MSI set to not use Reflection randoms :p

I do look forward to them being stable though.

nickrules

2010-11-18 19:53:19

Nononono, I don't me force the user to use them or anything like that. What I mean, is tell the script to call MSI_Findrandoms. Sorry, probably should have clarified.

Coh3n

2010-11-18 21:26:24

If the objects aren't found, it will search for randoms. When you encounter a player in a random, do you check to see if the debug said "Looking for randoms…"? This problem came up a while ago. It wouldn't detect the randoms until after it logged out then logged back in. No one has been able to figure out why this happens.

nickrules

2010-11-22 21:25:26

From: Coh3n
If the objects aren't found, it will search for randoms. When you encounter a player in a random, do you check to see if the debug said "Looking for randoms…"? This problem came up a while ago. It wouldn't detect the randoms until after it logged out then logged back in. No one has been able to figure out why this happens.




sorry it took so long to reply.

It wasn't checking for randoms. It seemed to be just checking like every point in the tpa….. which is a ton.

Coh3n

2010-11-23 01:23:25

From: nickrules
sorry it took so long to reply.

It wasn't checking for randoms. It seemed to be just checking like every point in the tpa….. which is a ton.

What random was it in where it was finding the object?

Sir R. M8gic1an

2010-11-23 14:52:30

Either way, I don't find this to be a bad idea.

Having a button to click on if we want it to check for randoms could be quite useful. :)

~RM

nickrules

2010-11-23 17:25:19

It was in the quiz random, it wasn't finding the object, but it wasn't returning false either - it just kept moving the mouse between the points where it found rocks (i could tell because of where the screen was painted).

Regardless though, this can't really harm anything - it can only do good imho. unless someone knows something contradicting this :rolleyes:

Coh3n

2010-11-24 01:23:32

From: nickrules
It was in the quiz random, it wasn't finding the object, but it wasn't returning false either - it just kept moving the mouse between the points where it found rocks (i could tell because of where the screen was painted).

Regardless though, this can't really harm anything - it can only do good imho. unless someone knows something contradicting this :rolleyes:

I know, but if MSI_FindRandoms was being called and just not finding the random, a feature like this wouldn't make a difference. The MSI_FindRandoms isn't getting called, then yes, it would be useful, but it should always get called.

nickrules

2010-11-25 09:29:17

Then something needs to be fixed in either the find rock loop/function or in findobject

Coh3n

2010-11-25 19:01:53

From: nickrules
Then something needs to be fixed in either the find rock loop/function or in findobject

I've added a Randoms check if the uptext isn't found. We'll see if that works (for now anyway). If you want to write code for the procedure to be called when you hit a certain key or something, be my guest. :)

NCDS

2010-12-15 16:20:46

From: Coh3n
I've added a Randoms check if the uptext isn't found. We'll see if that works (for now anyway).


Has this seemed to fix the issue, or are people still experiencing this problem?

Coh3n

2010-12-15 19:33:31

From: NCDS
Has this seemed to fix the issue, or are people still experiencing this problem?

Well I've been running MSI a lot lately and it's been solving a lot of randoms (my last report had 12 solved and 0 failed); however, I still think it logs out and uses that temporary "number of breaks" we added because it doesn't seem to find the random until it logs out and then back in.

It still absolutely blows my mind as to why that happens..

Yago

2011-07-27 22:10:54

Coh3n or NCDS… this was on the to-do list… I'm wondering what should be done…

NCDS

2011-07-27 22:33:37

From: Yago
Coh3n or NCDS… this was on the to-do list… I'm wondering what should be done…


The original theory, IIRC, was to call MSI_FindRandoms on a certain key press, e.g. F11 or any other one that may work.. (I don't have time to read the thread atm as I'm doing school work)

Yago

2011-07-27 22:34:54

From: NCDS
The original theory, IIRC, was to call MSI_FindRandoms on a certain key press, e.g. F11 or any other one that may work.. (I don't have time to read the thread atm as I'm doing school work)


Wouldn't we need multithreading? Also, a simple fix would be to just call findrandoms and break out of whatever loop the script is in right?

I believe this is resolved…

NCDS

2011-07-27 22:36:53

From: Yago
Wouldn't we need multithreading? Also, a simple fix would be to just call findrandoms and break out of whatever loop the script is in right?

I believe this is resolved…


Don't need multi threading, though that would be ideal. However, it can be done by calling if IsFKeyDown() in commonly occurring loops, or a similar method.

Yago

2011-07-27 22:42:16

From: NCDS
Don't need multi threading, though that would be ideal. However, it can be done by calling if IsFKeyDown() in commonly occurring loops, or a similar method.


Wouldn't we have to call it all the time though? If not it would only work half the time…

NCDS

2011-07-27 22:53:14

From: Yago
Wouldn't we have to call it all the time though? If not it would only work half the time…


That's the issue, lol. It has to be placed in a spot (or a few spots) where it would be called enough to be able to react in as little time as possible.

I really don't think this should be much of a priority anymore as MSI_FindRandoms is called every few seconds anyways as it is. This idea was brought up at a time when randoms weren't being detected as well as they are now. However, would still be a nice feature. :)

Coh3n

2011-07-28 10:34:42

Here's how I think we should do it. I was experimenting with the concept the other day because I'm going to have the new form work as the player remote so the user can reset EVERYTHING about the player/script. I tested it and isKeyDown will return true if the key is being held down whenever it's called. So, since MSI_FindRandoms exits if the time between calls hasn't exceeded what the user specified, we just have to add an if statement so it won't exit.

// from MSI_FindRandoms
if (not isKeyDown(VK_F11) then
if (not Force) then
if (NextRandCheck > GetSystemTime) then
Exit;
To test that you could wait for "Scanning for randoms…" in the debug, then hold F11 and see if the same message appears shortly after.

Yago

2011-07-28 11:42:35

Want my opinion…. We should place MSI_FindRandoms everywhere in MSI and there problem solved… Its a lot easier.

I thought about the whole timer thing last night before reading your post Coh3n and before falling asleep but If you honestly think about it adding more randoms checks would fix this issue…

This is me saying it nicely :)

NCDS

2011-07-28 14:47:38

From: Yago
Want my opinion…. We should place MSI_FindRandoms everywhere in MSI and there problem solved… Its a lot easier.

I thought about the whole timer thing last night before reading your post Coh3n and before falling asleep but If you honestly think about it adding more randoms checks would fix this issue…

This is me saying it nicely :)


It can also make MSI seem more 'bloated' and slow things down on an older PC if we did it that way. That's the whole reason we have the timer, and are pushing for this feature.

Yago

2011-07-28 14:53:00

From: NCDS
It can also make MSI seem more 'bloated' and slow things down on an older PC if we did it that way. That's the whole reason we have the timer, and are pushing for this feature.


Ill do it then… What should the fkey or keys be and any other details?

NCDS

2011-07-28 14:56:35

From: Yago
Ill do it then… What should the fkey or keys be and any other details?


Whatever works. Use your imagination and do what you think works best, that's all we ask for. :)

Worst that can happen is we change a few things around to increase efficiency or speed. It's a community script remember, have fun with it. :)

Coh3n

2011-07-28 19:35:33

Yeah honestly, I don't think there's much more to it from what I posted. You probably could add some debugging so it'll print something like

---- Forcing a randoms search

Yago

2011-07-28 20:31:28

From: Coh3n
Yeah honestly, I don't think there's much more to it from what I posted. You probably could add some debugging so it'll print something like

---- Forcing a randoms search


I've got the function. Its simple so ill commit what I have.

Coh3n

2011-08-13 18:11:45

Check out SMART 6.7beta. The typing through SMART works flawlessly and I've personally tested the F keys. This means that using F12 or 10 or whatever to force a findRandoms call should work perfectly now. :)

Yago

2011-08-15 13:26:34

From: Coh3n
Check out SMART 6.7beta. The typing through SMART works flawlessly and I've personally tested the F keys. This means that using F12 or 10 or whatever to force a findRandoms call should work perfectly now. :)


Thanks Coh3n. I personally put this on hold till the fix to SMART. If you would like I can commit what I have and its wont work regardless but when the new SMART fix is released it'll work…

Coh3n

2011-08-15 22:14:00

From: Yago
Thanks Coh3n. I personally put this on hold till the fix to SMART. If you would like I can commit what I have and its wont work regardless but when the new SMART fix is released it'll work…
Test it with SMART 6.7beta and if all is good, we'll add it and just tell people that it only works with the newest SMART.

Yago

2011-08-18 22:07:55

I got the newest SMART. Just have to say thanks to benland.

I was testing it out and no luck. I tried isfkeydown and iskeydown with no luck…

Also, i noticed that when you press certain fkeys it interacts with the game such as opening different tabs including inv tab and such.

NCDS

2011-08-18 22:38:59

From: Yago
I got the newest SMART. Just have to say thanks to benland.

I was testing it out and no luck. I tried isfkeydown and iskeydown with no luck…

Try it with an all color script or at a point where there are no reflection functions being used as I've seen reports that during reflection calls the key strokes aren't recognized my SMART.

Perhaps if this doesn't work still we could paint a little button on SMART and react with an onClick event. Not positive how well that would work, but just a though.

Coh3n

2011-08-19 02:36:33

From: Yago
Also, i noticed that when you press certain fkeys it interacts with the game such as opening different tabs including inv tab and such.
Does that not mean it's working?

Yago

2011-08-19 10:26:10

Wait actually i think I have made an error. I'm running simba off of a flash drive, so every-time I open simba the plugins get reset(including libsmart.dll). Ill try in my home computer later today.

Does MSI debug every line you set it to? I might use writeln instead of MSI_Debug. The first time i tested it with smart 6.7 it would perform a wait but not debug anything like i Set it to…

Ill test it again

Coh3n

2011-08-19 12:10:40

From: Yago
Wait actually i think I have made an error. I'm running simba off of a flash drive, so every-time I open simba the plugins get reset(including libsmart.dll). Ill try in my home computer later today.

Does MSI debug every line you set it to? I might use writeln instead of MSI_Debug. The first time i tested it with smart 6.7 it would perform a wait but not debug anything like i Set it to…

Ill test it again
I wouldn't think the plugin should reset.

And MSI_Debug will always work unless you have the DEBUG_LEVEL set to a lower number. Also, if you want to know for sure if it's working do something like:

if (isFKeyDown(VK_F12)) then
showMessage('F12 key is down');
Could even go as far as this:

case messageDlg('','F12 was pressed, check for randoms?', mtConfirmation [mbYes, mbNo]) of
mrYes: MSI_FindRandoms;
mrNo: ;
end;

Yago

2011-08-19 13:34:24

OK ill try this. For the plugins I meant that since im on a flash drive for some reason it always disables the extensions, so when I enable them they always update.

I had the debugging level set to the normal but it wouldn't debug anything. However, It would wait a short amount of time even though I set no wait… I'll continue to test this.

Coh3n

2011-08-19 18:50:04

From: Yago
OK ill try this. For the plugins I meant that since im on a flash drive for some reason it always disables the extensions, so when I enable them they always update.

I had the debugging level set to the normal but it wouldn't debug anything. However, It would wait a short amount of time even though I set no wait… I'll continue to test this.
That's quite odd, let me know how it goes. If you can't figure it out, commit everything to you git repo and I'll pull and test it out as well when I have time.

Yago

2011-08-26 14:40:01

From: Coh3n
That's quite odd, let me know how it goes. If you can't figure it out, commit everything to you git repo and I'll pull and test it out as well when I have time.


OK so i finally found some time to work on this. Here's what I got:

1. With smart 6.7 beta, the fkeys still give problems… some open up tabs/dialogs within runescape.
2. I replaced the mainloop with isfkeydown loop and still nothing
3. Even though it failed, text was still going through to smart…
4. I even tried iskeydown with the same results. http://docs.villavu.com/simba/scriptref/mouseandkeyboard.html#keyboard-virtual-keys

Coh3n

2011-08-26 14:42:30

Just use an F key that doesn't do anything in RS? There are plenty of them also, can you post the code you're trying to test with?

Yago

2011-09-16 21:17:28

From: Coh3n
Just use an F key that doesn't do anything in RS? There are plenty of them also, can you post the code you're trying to test with?


Sorry to post this now cause I've been a bit busy lately, but i tried tab ctrl shift and all that jazz but still nothing….

Edit: I tried numbers too but obviously those went straight to Runescape.

Coh3n

2011-09-16 21:20:24

Can you post the code you've been trying (like what you changed in MSI)?

Yago

2011-09-16 21:27:17

From: Coh3n
Can you post the code you've been trying (like what you changed in MSI)?


Oh yeah. If I recall I replaced MSI_Mainloop with something like
repeat 
wait(100);
if isFKeyDown(SomeNumber Usually 8 - 11) or isKeyDown(121 or 16 or 9 which are f10 shift and tab) then
writeln('This doesn''t work');
until(false);

Coh3n

2011-09-16 21:33:02

You should test the way it's going to be used (from MSI_FindRandoms):

if (not LoggedIn) then
Exit;

MSI_LevelUp();
if (LeaveDangerZone) then
MSI_SubDebug('Left danger zone');

gameTab(TAB_INV);

if (not force) then
if (isFKeyDown(VK_F12)) then
begin
force := true;
MSI_Debug('F12 key is down, forcing random call');
ShowMessage('F12 is down, forcing random call'); // for testing purposes
end;

if (not Force) then
if (NextRandCheck > GetSystemTime) then
Exit;
Then just run MSI, and hold down F12 and see what happens (you may have to hold it down for a minute, I'm not sure).

Yago

2011-09-16 21:54:24

From: Coh3n
You should test the way it's going to be used (from MSI_FindRandoms):

if (not LoggedIn) then
Exit;

MSI_LevelUp();
if (LeaveDangerZone) then
MSI_SubDebug('Left danger zone');

gameTab(TAB_INV);

if (not force) then
if (isFKeyDown(VK_F12)) then
begin
force := true;
MSI_Debug('F12 key is down, forcing random call');
ShowMessage('F12 is down, forcing random call'); // for testing purposes
end;

if (not Force) then
if (NextRandCheck > GetSystemTime) then
Exit;
Then just run MSI, and hold down F12 and see what happens (you may have to hold it down for a minute, I'm not sure).


Does this work for you? I tried something similar to this before with a different Fkey and it failed.
So, I replaced the mainloop with the repeat until loop and still nothing…

Coh3n

2011-09-17 02:24:27

I'm not sure. I've tested IsFKeyDown with SMART, though and it worked. Just haven't tested in MSI itself. I will as soon as I can, though.

E: Yeah I tested it out and it really doesn't look like it's going to work. Even when I can get the type-through feature to work properly, isFKeyDown and isKeyDown both don't seem to be working. I'll mark this thread as denied or resolved unless we can figure something else out.

Yago

2011-09-17 21:48:52

Well that ends this chapter unless wizzup or Ben can tell us what's happening.

Wizzup?

2011-09-18 06:03:52

To be honest ``Denied'' somehow feels offensive to me. Perhaps make it WONTFIX? or NO CHANGE REQUIRED.

E: Wait, I can see you need me help with something SMART related. I'll try to get back to this in a few days.

Coh3n

2011-09-18 18:51:15

From: Wizzup?
To be honest ``Denied'' somehow feels offensive to me. Perhaps make it WONTFIX? or NO CHANGE REQUIRED.

E: Wait, I can see you need me help with something SMART related. I'll try to get back to this in a few days.
It's just the prefix. Could be changed I suppose. Is "Declined" any better? :p

And, I have no idea whether it's Simba or SMART related, it just doesn't seem to recognize that the F keys were being pressed (in my case VK_F12). I have two instances of SMART running right now. One I can type through perfectly without issues (it even recognizes the designated F keys and switches to the corresponding game tab), the other doesn't work at all. If I minimize/restore SMART, the keys I types show up, but I still can't type through.