Log in

View Full Version : Amending a script whilst its running?



twobac
02-03-2007, 05:21 PM
Is it possible to amend a script whilst its running? e.g. to add a extra line of code or a new player?

Cheers

Boreas
02-03-2007, 05:28 PM
No.

I'm writing something that let's you change the values of variables during runtime. But you can't add lines.

tarajunky
02-03-2007, 06:40 PM
Apparently it is possible to have a form stay open while the script runs. This would allow the user to change any variable within that form, including usernames, passwords, or anything else you would want to incorporate into a form.

twobac
02-05-2007, 12:12 PM
Well at least you could change the variables. That would be good. Reaojn for asking is due to the long runtime I get on scripts (curently 48hrs+) and would like the players to progress onto the next ore type by design, rather than via the bug in the player form.

tarajunky
02-05-2007, 06:36 PM
Have it autoselect the ore type based on your mining level and which pickaxe you have available.

I do it like this...



Procedure AutoSelectOres(PickType:string);
var Addy,Rune,Mith:integer;
begin
PickType:=LowerCase(PickType);
Rune := DTMFromString('78DA63B4616060086700034608C560171CC BC' +
'005E5FF0702467B202382010D30A2E801AB09475561A0A080 AAC6' +
'054844E336870944DB028958DCE680D55801897802E678008 944F' +
'CE600000DC50A9A');
Addy := DTMFromString('78DA63EC67606058CD00068C108AC13DCA8 38' +
'10BCAFF0F048C73808CCD0C28C0404101450FE36C20B18580 9A29' +
'40620D031A604455D30724961350D30324B6E2B70B00BE170 DDD');
Mith := DTMFromString('78DA639CC5C0C0B098010C18211483B9793 00' +
'31794FF1F08189701196B1950808182028A1EC6A540622501 35D3' +
'80C4320634C088AA66369058805F0D00C37B0C0A');
GameTab(4);
if random(100)>50 then Players[CurrentPlayer].String1 := 'Copper'
else Players[CurrentPlayer].String1 := 'Tin';
if random(100)>50 then Players[CurrentPlayer].String2 := 'Copper'
else Players[CurrentPlayer].String2 := 'Tin';
if random(100)>50 then Players[CurrentPlayer].String3 := 'Copper'
else Players[CurrentPlayer].String3 := 'Tin';
SecondsToWait:=25;
Case PickType of
'rune': begin
if (FindDTM(Rune,x,y,MIX1,MIY1,MIX2,MIY2) or (FindDTM(Addy,x,y,MIX1,MIY1,MIX2,MIY2) and (Players[CurrentPlayer].level[15]>=50))) then
begin
Players[CurrentPlayer].String1 := 'Iron';
Players[CurrentPlayer].String2 := 'Iron';
Players[CurrentPlayer].String3 := 'Iron';
SecondsToWait:=5;
end else if FindDTM(Addy,x,y,MIX1,MIY1,MIX2,MIY2)
or FindDTM(Mith,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
Players[CurrentPlayer].String1 := 'Iron';
Players[CurrentPlayer].String2 := 'Iron';
SecondsToWait:=10;
end else
begin
Players[CurrentPlayer].String1 := 'Iron';
SecondsToWait:=15;
end;
end;
'adamant' :begin
if FindDTM(Addy,x,y,MIX1,MIY1,MIX2,MIY2)
or FindDTM(Mith,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
Players[CurrentPlayer].String1 := 'Iron';
Players[CurrentPlayer].String2 := 'Iron';
SecondsToWait:=10;
end else
begin
Players[CurrentPlayer].String1 := 'Iron';
SecondsToWait:=15;
end;
end;
'mithril' :begin
if FindDTM(Mith,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
Players[CurrentPlayer].String1 := 'Iron';
Players[CurrentPlayer].String2 := 'Iron';
SecondsToWait:=10;
end else
begin
Players[CurrentPlayer].String1 := 'Iron';
SecondsToWait:=15;
end;
end;
end;
FreeDTM(Rune);
FreeDTM(Addy);
FreeDTM(Mith);
end;

stilfly
02-09-2007, 12:14 PM
Why not just stop it? Lol, I'll admit it is challenging to stop those beautiful 14 hour runs to change something, but...

SubiN
02-09-2007, 02:01 PM
then u'll loose the beautiful Report lol

Boreas
02-09-2007, 02:04 PM
Yea for the reports, but also for some scripts the starting point is pretty far from the autoing point, and moving a bunch of players is a pain. After the initial work of adding the feature, it's just easier. Maybe I'm just lazy, but whatever.