After learning myself creating a Form i wanted to make it universal for myself.
So I created 1 form, which i can modify with a procedure.
This is My read me:
Code:
This is a script which is able to save/load up to 10 players ( 0-9 )
It uses just 1 INI file to store settings in, which can be loaded by every script you would like,
As long "_Player_Management.simba" is included ofcourse
You Define your player settings in the form and you can load the values in your script.
Only Username, Password and PIN are the same for each script.
You can only load / save settings of the current script you are running.
Build in:
Password hider: Shows your password as '********'
Pin hider: shows your pin as '****'
Save settings for your current script for each player ( 0-9 )
Switching players in the form
Clear button for clearing the current player settings, not the player itself
Automaticly Setting up the First Player ( Players[0] )
Loading Values in your own Script
"Scriptname Setup" as Title of the Form
Form Automaticly Alignment:
Custom Width ( with a Minimal of 450 )
Custom Offset of Second row Checkboxes
Automaticly Checkbox Generator ( Which you have defined )
Automaticly adjust Form on Custom Checkboxes
The next 2 images are created using this script:
Simba Code:
program Sample_Universal_Form;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i Scripts/_Player_Management.simba}
{$i Scripts/_Universal_Form.simba}
var
V1 : TVariantArray ; // For Showing the Form
V2 : Array of string ; // Defining Names for each Checkboxes in the Form
const
Scriptname = 'Universal Form' ;
begin
V2 := [ 'Option 1','Option 2','Option 3','Option 4','Option 5','Option 6','Option 7','Option 8' ] ;
ClearDebug ;
CreateINIfile ;
// Setting up the form: Scriptname, Form Widht, Align Right Checkbox 2 From left, Lamp skill for active player
FormINISettings( Scriptname,450,200,SKILL_RUNECRAFTING ) ;
// With Checkbox options
FormINICheckBoxes( V2 ) ;
ThreadSafeCall( 'ShowForm', V1 ) ;
// Loading a value of the INI file: Player ID ( Shown in the Form (0-9), Variable Name
Writeln( ReadINIfile( 0, 'active' ) ) ;
// Saving a value in the INI file: Player ID ( Shown in the Form (0-9), Variable Name, Variable Value
WriteINIfile( 0, 'active', 'False' ) ;
Writeln( ReadINIfile( 0, 'active' ) ) ;
// V2 is/are the name(s) of the variables that are set
Writeln( ReadINIfile( 0, 'Option 1' ) ) ;
Writeln( ReadINIfile( 0, 'Option 2' ) ) ;
Writeln( ReadINIfile( 0, 'Option 3' ) ) ;
end.


Code:
Default variables names that are used:
user : Username
pass : Password
pin : Pin
Playtime : How long you would like to play for
Breaks : Insert Breaks
Playtime & Breaks are already set for you, But i didn't wrote code for these options.
Visit my Google drive > here< Where you can download the Source V1.0 ( readme included )
Hope You like it !