SRL Archive - The Bashing Club / BBQ Pit

The "Get better at scriping" game!


JAD

2007-06-26 21:14:53

Well, I think this could be a VERY good game to play, because we can have fun, and help each other grow as scripters as well :)

So here's how the game works.

Somebody post's what they want to either learn, or improve on (Example: I want to learn for to do loops, or I want to improve my abilities using cases….etc.).

So the next person who posts has to post something that would help the above person. So you'd post something linking to a sight that might be helpful in helping them learn/improve on what they said. You could link them to a tutorial. You could make a small tutorial on teaching them it if it's a small request :) you could offer to help them learn it on msn….etc.

And then once you post the help the person above you, you make a request yourself. If you don't have a request, but are just helping somebody, you can just post that, and then the next person who posts wouln't need to help anyone, they can just make a request :)

OK, so I hope I explained the rules well, here we go! :)




I want to know more about how to use Try/Except.

SKy Scripter

2007-06-26 21:36:18


program Example;




begin
try
Writeln(' Hello!');

finally
Writeln( 'BYE!');

except
Writeln(' oops! Could not Write Hello!');
end;
end.


program Example;




begin
try
Writeln(' Hello!');

except
Writeln(' oops! Could not Write Hello!');
end;
end.


Thats How Try And EXcept Work Try Will "Try" and do it
if fail then it will go to except!


ok me i want to learn how to encrypt SCAR Codes!!!!

Harry

2007-06-26 21:50:29

Standards. :D

JAD

2007-06-26 21:53:19

From: SKy Scripter

program Example;




begin
try
Writeln(' Hello!');

finally
Writeln( 'BYE!');

except
Writeln(' oops! Could not Write Hello!');
end;
end.


program Example;




begin
try
Writeln(' Hello!');

except
Writeln(' oops! Could not Write Hello!');
end;
end.


Thats How Try And EXcept Work Try Will "Try" and do it
if fail then it will go to except!


ok me i want to learn how to encrypt SCAR Codes!!!!


I knew that :) But what I didn't know was could you do try 2 things except?


try
begin
FindColor(x,y,123512,MSX1,MSY1,MSX2,MSY2);
GameTab(4);
FindDTM(agwa,x,y,MSX1,MSY1,MSX2,MSY2);
end;
except
begin
FindColor(x,y,1235123,MSX2,MSY1,MSX2,MSY2);
GameTab(5);
FindDTM(awga,x,y,MMX1,MMY1,MMX2,MMY2);
end;

Hmm.. Now would that do the except if it didn't do all those things in the try? And would it stop right away in the try if it didn't find the color, or would it just continue, try to do the next 2 things, and then go to the except?

Next person continue with helping SKy :) But if you have the answer to my question, you can post that to :)

A G E N T

2007-06-26 22:35:46

Sky_scripter, you asked a really tough one. No fair. I would ask Starblaster100 if I were you (s)he (??) is really good at encryption and stuff. (S)he (?? again) is a busy person though, so I dunno if (s)he'll have time.

However there are various online tools for encryption, such as this one:
http://support.persits.com/encrypt/demo_text.asp
not sure how to integrate that into scripts though :(

WhiteShadow

2007-06-26 22:57:38

try..except is specifically for runtime errors and other errors.

try 
(try this if error in compilation then use the code below)
except
(then do this)
end;

EDIT:

try
begin
FindColor(x,y,123512,MSX1,MSY1,MSX2,MSY2);
GameTab(4);
FindDTM(agwa,x,y,MSX1,MSY1,MSX2,MSY2);
end;
except
begin
FindColor(x,y,1235123,MSX2,MSY1,MSX2,MSY2);
GameTab(5);
FindDTM(awga,x,y,MMX1,MMY1,MMX2,MMY2);
end;

That would just do the first part, not the second. There's no reason for the first part to have any errors.

Smartzkid

2007-06-26 23:37:24

Since it seems that Whiteshadow knows everything (or just didn't feel like asking a new question), I'll post this try-except example for JAD, just in case he still doesn't get it :p

program TryExcept;
var
NonExistantBitmap: integer;
begin
ClearDebug;
try //This is what should be executed
FreeBitmap(NonExistantBitmap);
except //This will be executed if something goes wrong above
writeln('Something went wrong when we were freeing the bitmap');
finally //This will be executed nomatter what
writeln('');
end;
writeln('But, because of this try-except, the script can go on');
writeln('instead of terminating like it will below');
writeln('');

//Without the try-except

FreeBitmap(NonExistantBitmap);

writeln('This part of the script won''t be executed, ''cause the');
writeln('above code will cause an error');
end.

I wouldn't mind knowing how to use compiler directives

WhiteShadow

2007-06-26 23:47:03

*Thinks harder.

If I had questions, I would have asked somebody already. :]

EDIT:

I'd probably want to know to know how to make Plugins. ;D

Timothegreat

2007-08-08 17:32:55

srry i dont know about plugins but i would like to know how to put a big picture as a background for your form in a script and not make it lag… (picture is 20000+ lines long!)

~alex~

2007-08-08 17:43:25

Look at chapter 7

Erm.. Im not sure what I want to know… Errr…. Meh Pass. ( I know all muahahahah)

RAM

2007-08-08 19:17:58

From: ~alex~
Look at chapter 7

Erm.. Im not sure what I want to know… Errr…. Meh Pass. ( I know all muahahahah)


~alexisanoob~….was I close :cartman:

I want to know how to set my Nicknames….

~alex~

2007-08-08 19:20:04

Lol @ ram

[offtopic] Ram stole my tilde thing at the end of his posts! [/offtopic]

bullzeye95

2007-08-08 20:08:38

For the encryption question, only Freddy1990 can do that.

I would like to know how SymbolAcc (whatever it's called) works.

Spky

2007-08-08 20:48:50

Umm symbol tolerence? Idk.


I would like to know how why:

* Pointers in Scar don't work.
* Stuff like
with TEtc.Create do
begin
...
...
end;
Doesn't work.

Bla bla bla.. Pascal Script's problem.. bla bla bla. Pfft.

SKy Scripter

2007-08-09 02:27:13

From: Spky
Umm symbol tolerence? Idk.


I would like to know how why:

* Pointers in Scar don't work.
* Stuff like
with TEtc.Create do
begin
...
...
end;
Doesn't work.

Bla bla bla.. Pascal Script's problem.. bla bla bla. Pfft.


i dont know if this answers your question.
but remember i think "With" can only be used with class type. like (TForm, TImage, and ect..)
things like TPoint, with record in it wont work in SCAR… i guess..
im not exactly sure though…

but look at this…



program new;

const
FormStyle = 1; (* 1 - 7 *)



var
MainForm : TForm;
Form_Style : Integer;


procedure OnPaint(sender : TObject);
var
ar, ag, ab, r, g, b, i : Integer;
begin
case Form_Style of
1 : ar := 1;
2 : ag := 1;
3 : ab := 1;
4 : begin ar := 1; ag := 1; end;
5 : begin ag := 1; ab := 1; end;
6 : begin ar := 1; ab := 1; end;
7 : begin ar := 1; ag := 1; ab := 1; end;
end;
MainForm.Canvas.Pen.Width := 3;
for i := 0 to 255 do
begin
R := R + ar; G := G + ag; B := B + ab;
with MainForm do
begin
Canvas.Pen.Color := RGBtoColor(R, G, B);
Canvas.MoveTo(0, i * 2);
Canvas.LineTo(500, i * 2);
end;
end;
end;




procedure InitForm;
begin
MainForm := CreateForm;
with MainForm do
begin
SetBounds(0, 0, 500, 400);
POSITION:= poDesktopCenter;
BORDERICONS:= [biMinimize, biSystemMenu];
BORDERSTYLE:= bsSingle;
Caption := '';
Canvas.Pen.Color := 255;
Canvas.Brush.Style := bsClear;
OnPaint := @OnPaint;
end;

MainForm.ShowModal;
end;

procedure SafeInitForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('InitForm', v);
end;


begin
try
Form_Style := FormStyle;
SafeInitForm;

finally
FreeForm(MainForm)

except
Writeln('ERROR: With Loading');

end;

end.


my question… Why Can Only The Key Type Word "IN" only work with Setted Types… (IN SCAR)

for example… This Is What Works….

program test;
type
TSomthing = (sTrue, sFalse, sMaybe);

TSome = set of TSomthing;

var
S : TSome;
begin
S := [sTrue, sMaybe];

if (sTrue in S) and (sMaybe in S) then
Writeln('Muahahahah');

end.

This What i want :( or somthing like that :p


program test;


var
Key : Integer;
begin
Key := 5;

if (Key in [1..50]) then Writeln('Woot!');

end.

Wizzup?

2007-08-09 05:21:29

From: WhiteShadow
*Thinks harder.

If I had questions, I would have asked somebody already. :]

EDIT:

I'd probably want to know to know how to make Plugins. ;D


Borland Delphi. :)

Hugolord

2007-08-09 06:00:24

i want to learn to script with delphi

and possibly know the 'rules' for obfuscation (manually)

Spky

2007-08-09 06:59:06

Yeh Sky, but Pascal Script doesn't support stuffs like:

with TForm.Create do
begin
Caption:= 'Boo';
...
end;
and neither does it support lists
if (0 in [-1..1]) then
or pointers

var
I, J : Integer;
Pointer : ^Integer;

begin
I := 200;
Writeln('I is @ ' + IntToStr(@I));
Pointer := @I;
J:= Pointer^;
end;

Bourdou!

2007-08-09 15:02:28

…SRL. lol…

Spky

2007-08-09 21:17:18

From: Bourdou
…SRL. lol…


Eh?

SKy Scripter

2007-08-09 23:41:30

From: Spky
Yeh Sky, but Pascal Script doesn't support stuffs like:

with TForm.Create do
begin
Caption:= 'Boo';
...
end;
and neither does it support lists
if (0 in [-1..1]) then
or pointers

var
I, J : Integer;
Pointer : ^Integer;

begin
I := 200;
Writeln('I is @ ' + IntToStr(@I));
Pointer := @I;
J:= Pointer^;
end;


Agh. thats sad :( (would be helpful in some areas)

Ejjman

2007-08-10 01:35:07

I still don't see the use of pointers I'm lost o.O


Where to use 3D arrays?

Pyro

2007-08-19 06:15:07

For whoever asked about symbol accuracy. … it searches for a deformed bitmap. Then returns the percentage of how close it was to the bitmap. For example if it was exactly the same it would be 1.0 aka 100 percent. If it was 50% distorted it would come back as 0.5 etc etc. Its just the distortion level and how much it was distorted.

obfuscation is basically jsut replacing all strings and maybe numbers in the script with either variables or constants. For example

writeln('Hello WOrld')

becomes

const
abcdrandomshit='Hello world';

writeln(abcdrandomshit);

thus looking through script all you can see is a bunch of rnadom letters and chracters that have been substitued in. This is also done with numbers thus making the script incredibly hard to read. Next the same thign is done with the procedures so say i have..

procedure dothisok;
begin
end;

begin//main loop
dothisok;
end.

it now becomes

procedure abcdrandomshit;
begin
end;

begin
abcdrandomshit;
end.

Thus making it even more harder to read with all the random letters and spacing. Every instance where the proc is called is also changed the the random number lettering that was assigned to the procedure.

Next everything is moved onto as little lines as possible. Thus making it so its just one huge line of code going right the way accross.

Basically it is designed to make the code incredibly hard to read. If you need mroe info add me on msn. Obfus is able to be cracked. But it is so hard to read you mayaswell just not bother. You will spend all day sorting out the vars.