SRL Archive - Help

clicking stuff in inventory slot


grats

2011-03-24 13:29:25

Well I wanted to create a script to enchant rings, I wasn't sure what I should use for it? I was thinking bitmap because inventory stuff doesn't change?

I know how to do the stuff with TPA's for like MSCX, MSCY is it MICX for main inventory? main screen C = MSC (not sure what the C stands for)
does MIC = main inventory C or is it something different?


here are some bitmaps (hosting sites change them to png..)



I should be getting my new motherboard today so I'll be able to get on at home again..

thanks for any help on which I should use / how I should do it, this will probably be my first script I put in the public scripts.. because I don't think we have anything to enchant rings right now.. (will add other colors)





whoops sorry meant to put this in scripting help if someone can move this, hard to figure stuff out on a small ipod screen lol

Floor66

2011-03-24 13:49:01

Use DTMs/Bitmaps. I don't see why/how you'd use TPA's for this :P

PatDuffy

2011-03-24 14:10:01

I would use a universal ring dtm, so that later when you added other rings you wouldn't need more bitmaps. For finding the dtm the foods would be MIX1,MIY1,MIX2, MIY2. The C in the other coords stands for Center, and is used when searching outwards from the center, which shouldn't be needed for the inventory.

As for spell selection bitmaps will work fine, and you could easily use a case of statement to determine which rings to enchant, then create a function to find the universal ring bitmap I mentioned.

Typing this from my Android so if you still need help I could offer better advice in a few hours when I get home.

Brandon

2011-03-24 14:20:34

Actually what I don't like about using dtm's and bitmaps for this is that u would also have to use uptext because after a ring is enchanted, it will look exactly the same and will be clicked again unless u make an array of the invent and cluck every slot once..

I say do something like R_ClickItemBy(2552, true, '') where 2552 would be the emerald ring ID.. That way it will never click a ring that Is already enchanted.. True is left click, false is right click.. '' means use.. Or whatever option you want.. Maybe u can do 'cast spell'

masterBB

2011-03-24 14:26:11

From the SRL-include
{ const MIX1, MIY1, MIX2, MIY2;
Description: Inventory EdgePoints. }
const
MIX1 = 547;
MIY1 = 202;
MIX2 = 737;
MIY2 = 466;

{ const MICX, MICY;
Description: Inventory Centre Points. }
const
MICX = 642;
MICY = 334;

I also suggest DTM over Bitmap. DTM's work pretty good with invs.

**BANNED The Man

2011-03-24 14:39:44

Check out how SRL's DropItem works?
Then just modify it :)

PatDuffy

2011-03-24 15:03:26

Thanks ggzz, I didn't even think of that when I offered my suggestion. So then you could still use a bitmap for the spell, then do a type of click inv by position and cycle through the positions.

Of course that is a non reflection alternative.

grats

2011-03-24 20:03:26

From: PatDuffy
I would use a universal ring dtm, so that later when you added other rings you wouldn't need more bitmaps. For finding the dtm the foods would be MIX1,MIY1,MIX2, MIY2. The C in the other coords stands for Center, and is used when searching outwards from the center, which shouldn't be needed for the inventory.

As for spell selection bitmaps will work fine, and you could easily use a case of statement to determine which rings to enchant, then create a function to find the universal ring bitmap I mentioned.

Typing this from my Android so if you still need help I could offer better advice in a few hours when I get home.


Alright yea, so dtms are kind of like tpa's with the coords etc? and from what ggzz said, I'd have to have some type of uptext line to make sure it isn't enchanting a ring that's already enchanted

if you could help me later with that, thanks a bunch.



From: ggzz
Actually what I don't like about using dtm's and bitmaps for this is that u would also have to use uptext because after a ring is enchanted, it will look exactly the same and will be clicked again unless u make an array of the invent and cluck every slot once..

I say do something like R_ClickItemBy(2552, true, '') where 2552 would be the emerald ring ID.. That way it will never click a ring that Is already enchanted.. True is left click, false is right click.. '' means use.. Or whatever option you want.. Maybe u can do 'cast spell'


So it would be really easy to do the R_ClickItemBy(EmeraldRingID, true, '')
and then runescape auto switches from your magic tab to your bag each time you enchant/click the magic spell




From: PatDuffy
Thanks ggzz, I didn't even think of that when I offered my suggestion. So then you could still use a bitmap for the spell, then do a type of click inv by position and cycle through the positions.

Of course that is a non reflection alternative.


I don't like to use smart & reflection if I don't have to.. but if it's way easier to do that then I guess I could, I don't really know where to start with reflection though.




From: Floor66
Use DTMs/Bitmaps. I don't see why/how you'd use TPA's for this :P


Yea, I don't even know what I'm doing lol :bart:

Brandon

2011-03-24 20:24:06

Guessing If ur gunna use pure colour and no reflection at all, then you need U may want to look at ClickAllItemsExcept and make it click only 1 item… so you click enchant then ClickItemExcept enchanted ring, click spell again and repeat.. until Emerald rings no longer exist in the invent..

So basically While (FindItem(Emerald Rings….) = true) do ClickItemExcept wait(random(100)) Click spell

grats

2011-03-24 21:54:55

From: ggzz
Guessing If ur gunna use pure colour and no reflection at all, then you need U may want to look at ClickAllItemsExcept and make it click only 1 item… so you click enchant then ClickItemExcept enchanted ring, click spell again and repeat.. until Emerald rings no longer exist in the invent..

So basically While (FindItem(Emerald Rings….) = true) do ClickItemExcept wait(random(100)) Click spell


Alright seems too complex for me, I'll probably go with reflection then lol

Echo_

2011-03-25 13:19:58

You should take a peek at Inventory.scar in the SRL core, it has some great functions for reading the locations of items and interacting with them (even if the items are all similar in appearance, which seems to be your dilemma).

tom99

2011-03-25 15:50:27

Here is a procedure i made with the information you gave,hopefully works.

var ryggsekk,ringamount,magibok,ring,loopconf,x,y:integer;

procedure ringenchantinginprogress;
begin
ringamount:=26;//Change this to your amounts of rings -1
Writeln('Commiting magic training');
Ryggsekk := BitmapFromString(22, 22, 'beNolVGtTGlcYfg0a5SIg' +
'oKLcWe4XFRaWOyogKwKroC4ICiyygMpdTWJtnbb50E5t0sw0004/JW3T' +
'NplO+ws67df+rB7pzJkz58N5n/Pc5lQSw3p2yO72GKrD7J4ze+dMnj1K' +
'n5Wps+PMqJ4XAQgB5gAWARbG61mzxJT2GrWDViXL0InaUWpYy1w2clet' +
'A7ZItss77XK6X6FMMpABKDjQzXvOMrabI/fX9eB91T9KO+QACPaimutU' +
'M+3yNkK4Pt3tVzKdcuqitN0/SVkkYJmFPuX8gvV/VV95WTf+dO36eeT8' +
'pef888rz9tz27mm0R1nmx6zO9sPVQmxQTT9rHaLxUXXPIIKQlm/lAe0W' +
'fl6w/Tggfhut/HFtez8wfrjE3488H0arv46I+xrxTZvsb5sVACy9jkzo' +
'1qlhY38WwDQ/FTLIwlq+7THQdu6XBce7fuj3AXG7PecSwroatlXwWc5K' +
'KuC+Gn5RcVd8YglAr7l/0ch12TxyLGheyIes63pxSDHpEsAlabglNd+f' +
'OF/XXN2M3SmBlInHeJfvcmsZJXzLrN0zPoTwZFBvnua5E0CFTT7NdMIi' +
'PiCUMbMAaTlyzz8ls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ww3w12/vPrnD36zllqbTyDYh5JwgNNdBex1cWKp8PosdHe/fNUah' +
'OvOp+GCi71VD0HXBtYjIBnix9s7v973Ht4yrq9rxSXJ1Sf+u5l08V145' +
'lj01iU/szTStU4kCjqHAWuWhakWqmryr42i8a/cPrN0b+/WO8uQ6fXsV' +
'v7FKri4mFo4OzE6UEcWl2ujkZuRqpUy7KJLI4XLJ0URXyyMnxALw+Ir9' +
'6FLp3lfchTO5hVl8cjwbCkCBiLGpjpEyEog3TUFRaBRhRxHQbYPunBG9' +
'kEtsQIZB0iDpUY8oLKE6GEi2MlTCKhV8mfV05DcaqWzL7Et2Ha+U2apR' +
'rpT5YiaViXfnsX70kk32Mtm0Jgwii6LDbYlGgXL/B54zLWA=');
ringamount:=loopconf;


begin ringamount:=loopconf;
repeat
repeat
if findbitmaptolerancein(magibok,x,y,0, 0,1200,800,50) then break;
until(false)
wait(80);
clickmouse(x+8,y+15,true);
repeat
if(findcolorspiraltolerance(x,y,6082161,0, 0,1200,800,150)) then break;
until(false)
wait(240);
clickmouse(x,y,true);
wait(2500);

repeat
if findbitmaptolerancein(ryggsekk,x,y,0, 0,1200,800,50) then break;
until(false)
wait(80);
clickmouse(x+8,y+15,true);
wait(2500);

repeat
if findbitmaptolerancein(ring,x,y,0, 0,1200,800,50) then break;
until(false)
clickmouse(x+5,y+3,true);
loopconf:=loopconf-1;
until(loopconf=0)
end;
end;

procedure freeinvimg;
begin
freebitmap(ryggsekk);
freebitmap(ringamount);
freebitmap(magibok);
end;

begin
ringenchantinginprogress;
freeinvimg;
end.

grats

2011-03-26 02:30:05

All the ClickMouse 's were having problems compiling

I don't have any machine to run simba on right now, in a few days hopefully I can get my stuff up and running.

Thanks for the procedure though, I definitely learned from it, I'll check it out more tomorrow at my bros where I can run simba

cycrosism

2011-03-26 02:59:09

MouseInv I believe the function is.

Use bitmaps if you want to find something in particular. Check my signiture for the link for my Ultimate Bitmap Tutorial