SRL Archive - Scripting Help

Form Designer


EyYo96

2014-09-12 15:28:05

Hello, I am looking for a Simba Form Designer Tutorial. I want to make a form where you can choose between few options before the script starts.
I found this thread, but the links dosn't work. Link: https://villavu.com/forum/showthread.php?t=91724

I am glad of any help :)

3Garrett3

2014-09-12 15:31:08

I would recommend this: https://villavu.com/forum/showthread.php?t=107572

It shows you how to use the SRL Playerform and you can customize it pretty well - all without actually designing a custom form. I just learned it the other day and it literally takes 15 minutes tops to put it in your script.

EyYo96

2014-09-12 17:33:36

Have you tested it? I am using osrs include and pascal, seems only to work with lape, or am I wrong?

Coh3n

2014-09-12 17:44:31

From: EyYo96
Have you tested it? I am using osrs include and pascal, seems only to work with lape, or am I wrong?
Yeah that's only lape. This is the tutorial I used when I first made forms:

https://villavu.com/forum/showthread.php?t=41418&highlight=form+tutorial

It's meant for SCAR, but I think it will still work with Simba in PascalScript.

Good luck. :)

EyYo96

2014-09-12 18:34:44

I'll check it out, thanks :)

EyYo96

2014-09-12 21:02:53

Ok it seems to work. I dont understand how I can use the result. Example: I want to choose between gold ore and iron ore to mine. So i'll make a TComboBox. But how can I use it in the main procedure? (where it clicks the gold ore or iron)

EyYo96

2014-09-12 21:20:09


Image1 := TImage.Create(FrmDesign);
Image1.Parent := FrmDesign;
Image1.Left := 20;
Image1.Top := 20;
Image1.Width := {width of your image};
Image1.Height := {height of your image};
b := loadbitmap(C:\Program Files\test.bmp);
getbitmapsize(b, w, h);
copycanvas(getbitmapcanvas(b), Image1.canvas, 0, 0, w, h, 0, 0, w, h);

For some reason it does not work. Debugbox: "Unknown identifier 'C'".

b := loadbitmap(C:\Program Files\test.bmp);

And how could you make it so that other people can use the scipt and see the image? because the path wouldn't work?

bonsai

2014-09-13 01:27:05

Debugbox: "Unknown identifier 'C'".

b := loadbitmap(C:\Program Files\test.bmp);



b := loadbitmap('C:\Program Files\test.bmp');

For sharing, you turn the bitmap into a string and call bitmapfromstring() instead of loadbitmap()

In simba, tools->bitmap conversion

Choose "open", find your file, then choose "to string". It will print the bitmapfromstring() to the debug window.

EyYo96

2014-09-13 03:46:05

thank you. Getting this error:

[Error] (67:3): Unknown identifier 'copycanvas' at line 67

I use osrs include. I think I have to use 'DrawBitmap' instead of 'copycanvas'.


copycanvas(getbitmapcanvas(b), Image1.canvas, 0, 0, w, h, 0, 0, w, h);

With what should I replace the 'Getbitmapcanvas(b) and 'Image1.canvas'?

Coh3n

2014-09-15 10:57:39

From: EyYo96
thank you. Getting this error:

[Error] (67:3): Unknown identifier 'copycanvas' at line 67

I use osrs include. I think I have to use 'DrawBitmap' instead of 'copycanvas'.


copycanvas(getbitmapcanvas(b), Image1.canvas, 0, 0, w, h, 0, 0, w, h);

With what should I replace the 'Getbitmapcanvas(b) and 'Image1.canvas'?
I think you can do:

DrawBitmap(b, Image1.canvas, 0, 0);
I can't test so I don't know for sure, so I apologize if that doesn't work.