Log in

View Full Version : How do I do this method the mathamaticians way?



Sir Ducksworthy
03-08-2012, 03:42 PM
Although I know their is a better way to do this? I just havnt been confident enough to bother attempting it yet
Ignore that part im just sort of talking to myself their I kind of did attempt it now lol and I cant get my stupid head around it the way im really wanting

procedure whichclayy; //This is just the coords of the middle of each item in each space in each slot of the inventory
var //The procedure picks 1 of 28 Numbers Randomly each number coresponds to each slot, so when the number is picked it moves the mouse to that slot
whichclay: integer; //This I believe is a Good feature for Anti-Ban in combination with the 4/4 preset coord randomization provided with the mmouse function
begin //Although I know their is a better way to do this? I just havnt been confident enough to bother attempting it yet
whichclay:=0; //I should make a case of this now that I think of it
whichclay:=random(28); // x:=536 +(42*whichclay);??? so if x=0 which is 1 then 536 will equal 578 it gets more complicated then that tho dividing the math between 6 parts
if(whichclay=0 or 1 or 5 or 9)then mmouse(578,229,4,4); // WTF? if(whichclay=1 or 5 or 9 or 13 or 18 or 21 or 25)then x:=578; etc etc? thats the easy way right? how would i go the smarter way?
if(whichclay=1)then mmouse(578,229,4,4);
if(whichclay=2)then mmouse(620,229,4,4);
if(whichclay=3)then mmouse(661, 230,4,4);
if(whichclay=4)then mmouse(704, 231,4,4);

if(whichclay=5)then mmouse(578, 267,4,4);
if(whichclay=6)then mmouse(620, 267,4,4);
if(whichclay=7)then mmouse(662, 268,4,4);
if(whichclay=8)then mmouse(704, 267,4,4);

if(whichclay=9)then mmouse(577, 303,4,4);
if(whichclay=10)then mmouse(622, 304,4,4);
if(whichclay=11)then mmouse(664, 303,4,4);
if(whichclay=12)then mmouse(706, 302,4,4);

if(whichclay=13)then mmouse(579, 338,4,4);
if(whichclay=14)then mmouse(621, 338,4,4);
if(whichclay=15)then mmouse(663, 338,4,4);
if(whichclay=16)then mmouse(705, 339,4,4);

if(whichclay=17)then mmouse(577, 375,4,4);
if(whichclay=18)then mmouse(621, 373,4,4);
if(whichclay=19)then mmouse(662, 374,4,4);
if(whichclay=20)then mmouse(705, 375,4,4);

if(whichclay=21)then mmouse(579, 411,4,4);
if(whichclay=22)then mmouse(620, 412,4,4);
if(whichclay=23)then mmouse(662, 412,4,4);
if(whichclay=24)then mmouse(705, 411,4,4);

if(whichclay=25)then mmouse(578, 447,4,4);
if(whichclay=26)then mmouse(621, 446,4,4);
if(whichclay=27)then mmouse(664, 448,4,4);
if(whichclay=28)then mmouse(705, 446,4,4);
end;

Sin
03-08-2012, 03:46 PM
procedure whichclayy;.
var
WhichClay:Integer;
begin
WhichClay := RandomRange(1,28); //do this, otherwise if Whichclay lands on 0, you're screwed
MouseItem(WhichClay,3); //moves mouse
end;

Kyle Undefined
03-08-2012, 03:48 PM
Look in inventory.simba, there are a ton of useful features.


program new;
{$i srl/srl.simba}

procedure WhichClay();
var
invB : TBox;
begin
invB := InvBox(RandomRange(1, 28));
MMouse((invB.X1 + invB.X2) / 2, (invB.Y1 + invB.Y2) / 2, 5, 5);
end;

begin
SetupSRL();
WhichClay();
end.

Sin
03-08-2012, 03:49 PM
Kyle, I ninja'd you.
Plan worked perfectly, while you were distracted by my PM, I answered!

Sir Ducksworthy
03-08-2012, 03:51 PM
GNomg Im such a retard
Thankyou honarable masters

Kyle Undefined
03-08-2012, 03:51 PM
Yeah, but yours can be shortened up even more and won't compile ;)


procedure whichclayy;
begin
MouseItem(RandomRange(1, 28), 3); //moves mouse
end;

Sin
03-08-2012, 03:53 PM
Yeah, but yours can be shortened up even more and won't compile ;)


procedure whichclayy;
begin
MouseItem(RandomRange(1, 28), 3); //moves mouse
end;


Hehe true, I was in a rush when I saw you viewing the thread :3

Sir Ducksworthy
03-08-2012, 03:54 PM
rep+'d Both of u's cheers heaps
+
Learned like 3 Diff things just then