SRL Archive - First Scripts

Balance Stun -<Stun the Elemental Balance>-


Lolsen

2012-01-13 19:06:22

Sorry guys didn't think it would be so much of a big deal but apparantly it was and giving credits wasn't enough to release something already public with modifications to give variety to the people, I've made one that deos it in fight caves, you can find it as a reply to l0ser69's thread.

RISK

2012-01-13 19:17:55

You need to work on your standards, check out a great guide here: http://villavu.com/forum/showthread.php?t=60288

This:
Var
stun, x, y, StartTime: Integer;
You shouldn't use global variables. You should use local variables as much as you possibly can. Local variables are variables that are used only in a procedure/function.

Like you have here:
procedure DeclarePlayers;
Var i:integer;
Begin
NumberOfPlayers(1);
CurrentPlayer := 0;
For I := 0 to (1-1) Do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];

With Players[0] Do
Begin
Name := ''; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
Active := True;
Strings[0] :='stun'; //Name of spellto cast.(See list of spells above)
End; //Set to 'Range' if ranging!

End;

That is a local variable, the "i" and "var" before the begin .. end nest.


This:
procedure Findspell;
begin

stun := DTMFromString('mWAAAAHicY2FgYGBkgAA2KJsViLmhfBBIyylg6OyqZ/j9+zeDDK8KAxdQDBkzomEQAAAisQZh');
SetAngle(true)
GameTab(tab_Magic)
If FindDTM(stun, X, Y, MIX1, MIY1, MIX2, MIY2) then
begin


mouse( x, y, 3, 3, true);


FreeDTM(stun);
end;
end;

You free the DTM only if you actually find it. This is a memory leak and will cause an intensive haul on your computer. So you should have the "FreeDTM(stun)" after the finding method.


Other than those things, it's a very good first script. Great job! :) You should check out Coh3n's guide next: http://villavu.com/forum/showthread.php?t=49089

Flight

2012-01-13 19:34:21

Congratulations on your script. By the way, is it possible to cast sells on a elemental balance while in building mode?

Lolsen

2012-01-13 20:35:57

From: Flight
Congratulations on your script. By the way, is it possible to cast sells on a elemental balance while in building mode?


I just checked for you sir, :\ nope would be good but you can't

My next update I'll make it in Fight caves safespotting one of the monsters behind a rock, no randoms/reporters, perfect place for stun bot.

JN13

2012-01-13 20:42:02

Ty for making this man, ive been working on one for a while, as u know ;) but this puts it all together!

loser69

2012-01-13 22:12:00

Hey this is my script Lolz.

Scaper

2012-01-13 22:39:10

http://villavu.com/forum/showthread.php?p=889074#post889074



E:

Yea its loser69's script

you only changed 1 line maybe 2?

Deadly Serious

2012-01-13 23:03:35

You need to have actual permission from the owner of the script (Loser69) before stealing all his code and only change a few lines.

Lolsen

2012-01-14 05:06:41

Sorry guys didn't think it would be so much of a big deal but apparantly it was and giving credits wasn't enough to release something already public with modifications to give variety to the people, I've made one that deos it in fight caves, you can find it as a reply to l0ser69's thread.

loser69

2012-01-14 05:17:19

Hey no problem man it wasn't a big deal to me.

Lolsen

2012-01-14 05:19:44

From: loser69
Hey no problem man it wasn't a big deal to me.


I know dude <3

Just other people, well think of what I posted as a preset :)