A very good start for a first script... Here's some feedback.
First of all, You Included SRL twice:
Simba Code:
{.include srl/srl.scar}
{$DEFINE SMART}
{$i SRL/SRL.scar}
This Should work:
Simba Code:
{$DEFINE SMART}
{$i SRL/SRL.scar}
...
Simba Code:
Players[0].Nick :=''; //Used for random events
This isn't used for randoms anymore.
also, i see you still have problems with Random Function, and don't really know how to place the waits correctly, For example:
Simba Code:
procedure Cast;
begin
while GetCurrentTab = tab_Inv do
begin
Gametab(tab_Magic);
Wait(100+ Random(100));
end;
Let's take this out:
This, waits 100 ms, and an extra random number from 0 to 99, so 0 might not be the right think that you're looking for, what i'd recommend sometimes, is RandomRange function. For example:
Simba Code:
Wait(RandomRange(120, 200));
in this case, it does a Random wait with a range of 120 and 200, so it waits somewhere randomly between 120 and 200, or here's another example.
Simba Code:
Wait(100+ RandomRange(20, 100));
This is the same, just in an other way.
lets move further...
This:
Simba Code:
procedure Cast;
begin
while GetCurrentTab = tab_Inv do
begin
Gametab(tab_Magic);
Wait(100+ Random(100));
end;
while GetCurrentTab = tab_Magic do
begin
Wait(200 + Random(50));
xval := Random(10)+687; //Can somebody tell me how to get these values as at the moment I just guess.
yval := Random(10)+341;
Mouse(xval, yval, 1, 1, True);
xinval := Random(20)+569;
yinval := Random(20)+219;
Mouse(xinval, yinval, 1, 1, True);
end;
"Can somebody tell me how to get these values as at the moment I just guess."
I didn't really understand the question, so sorry, if you expected someone to answer that.
This:
Simba Code:
xval := Random(10)+687;
yval := Random(10)+341;
Mouse(xval, yval, 1, 1, True);
this part is completely unnecessary.
Simba Code:
Mouse(687, 341, 10, 10, True);
what it does is just the same thing, it clicks on the coords 687 and 341 plus a random of 10 in each coordinate.
That's it.
And if you have a problem, then please show it, give more information, so we can understand what you're trying to say/do.