Swatarianess
2011-11-21 04:11:13
So i am making a report for a merchanting script and just wanted to see if it was good and how i could improve it. Right now it calculates Profit margin + Total buying and total selling and if its above 1k it divides it by 1000 then adds a "k" if its below it doesn't divide it by 1000 and add "k". Also used the Declare players because i dont know how else to use strings, that and its easier to use it with the PlayerDeclares. So first Simba script i've made ^^ so how could i improve it? thanks in advance
program new;
{.include SRL\SRL.scar}
var
Abv1k: Integer;
By, sy, Mrj, buy1 : Double;
procedure DeclarePlayers;
begin
HowManyPlayers:= 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
{ Players[0].Name := 'Username';
Players[0].Pass := 'Password';
Players[0].Nick := 'Nickname';
Players[0].Pin := 'Pincode';
} Players[0].Strings[0]:= 'Rune scimi'; // Item to buy.
Players[0].Integers[0]:= 5; // Amount of Item to buy
Players[0].Integers[1]:= 10000; // Buying price (Sell item 1gp or way lower then med to aquire whilest flipping)
Players[0].Integers[2]:= 10550; // Selling price (buy higher med price of item)
Players[0].Active := true;
By := Players[CurrentPlayer].Integers[0] * Players[CurrentPlayer].Integers[1];
Sy := Players[CurrentPlayer].Integers[0] * Players[CurrentPlayer].Integers[2];
Mrj := Sy - By;
end;
begin
DeclarePlayers;
if(Players[0].Integers[1] and Players[0].Integers[2] > 1000) then
begin
writeln('----------------More_Than_1k--------------')
writeln('Buying: ' + Players[CurrentPlayer].Strings[0] + ' @' + IntToStr(Players[0].Integers[1] / 1000)+'k')
wait(100+randomrange(300,500))
writeln('Selling: ' + Players[CurrentPlayer].Strings[0] + ' x' + IntToStr(Players[CurrentPlayer].Integers[0]))
wait(100+randomrange(300,500))
writeln('Total Buy price= ' + FloatToStr(By / 1000)+ 'k')
wait(100+randomrange(300,500))
writeln('Total Sell price= ' + FloatToStr(Sy / 1000)+ 'k')
wait(100+randomrange(300,500))
writeln('Profit Majin = ' + FloatToStr(Mrj / 1000) + 'k')
writeln(FloatToStr(buy1 + 5.2))
writeln('------------------------------------------')
end;
if(Players[0].Integers[1] and Players[0].Integers[2] < 1000) then
begin
writeln('----------------Less_Than_1k--------------')
writeln('Buying: ' + Players[CurrentPlayer].Strings[0] + ' @' + IntToStr(Players[0].Integers[1]))
wait(100+randomrange(300,500))
writeln('Selling: ' + Players[CurrentPlayer].Strings[0] + ' x' + IntToStr(Players[CurrentPlayer].Integers[0]))
wait(100+randomrange(300,500))
writeln('Total Buy price= ' + FloatToStr(By))
wait(100+randomrange(300,500))
writeln('Total Sell price= ' + FloatToStr(Sy))
wait(100+randomrange(300,500))
writeln('Profit Majin = ' + FloatToStr(Mrj))
writeln('------------------------------------------')
end;
end.