Log in

View Full Version : Please help me with my script



mrlewcc
06-30-2012, 01:08 PM
I am quite new to Simba coding and I am trying to code my own fc bot however due to my limited knowledge I am finding it very difficult and I am wondering if someone could help me.

Here is my code so far:
program FcBot;
{$DEFINE SMART}
{$i SRL\SRL.simba}

const
SRLStats_User = ''; // Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
SERVER = 0; // Enter "0" to pick a random server.
MEMBERS = True;
NumbOfPlayers = 0;
StartPlayer = 0;


procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['XP'];
end;

procedure Typing;
Var
s : array of string;
begin
if (inchat('!Roll')) Then

begin
TypeSendEx('/You have rolled s');
end;
s := ['RandomRange(1,12)']
end;

begin
Smart_Signed := TRUE;
Smart_Members := MEMBERS;
Smart_SuperDetail := FALSE;
Smart_Server := 2;
ActivateClient;
SetupSRL;
DeclarePlayers;
if not (LoggedIn) then
LoginPlayer;
Wait(4000+random(400));
end.

All I am trying to do is for the bot to generate a random number between 1 and 12 and say it when the person says !Roll in the friends chat, and I can't get that to happen also when I left the random part out the bot wouldn't say it just once it would say it a numerous amount of times untill the !Roll is gone from the chat box.

If someone could help me I would be very greatful.

riwu
06-30-2012, 01:17 PM
You should define 's' before u TypeSend it. (How is it suppose to to know what is 's' if u only tell it afterwards?)
Also u should not put s within '' as it will type s instead of what s is.
Here is the code that should work:
program FcBot;
{$DEFINE SMART}
{$i SRL\SRL.simba}

const
SRLStats_User = ''; // Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
SERVER = 0; // Enter "0" to pick a random server.
MEMBERS = True;
NumbOfPlayers = 0;
StartPlayer = 0;


procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['XP'];
end;

procedure Typing;
Var
s : string;
begin
if (inchat('!Roll')) Then
begin
s:= IntToStr(RandomRange(1,12));
TypeSendEx('/You have rolled '+s,true);
wait(randomrange(2000,3000)); //wait so that Roll will no longer be in last chat
end;
end;

begin
Smart_Signed := TRUE;
Smart_Members := MEMBERS;
Smart_SuperDetail := FALSE;
Smart_Server := 2;
ActivateClient;
SetupSRL;
DeclarePlayers;
if not (LoggedIn) then
LoginPlayer;
Wait(4000+random(400));
repeat //dont forget ur mainloop!
Typing;
until(false);
end.

mrlewcc
06-30-2012, 01:25 PM
Thank you so much bro!
I'll carry on and try to get as good as you are in simba <3

Crit
06-30-2012, 02:04 PM
You should also fix your declare players to have username, pass, pin etc
Otherwise just use riwu's example. If you are insure of the declare players check out the tutorial for beginners and check out the different tuts.
Link:http://villavu.com/forum/forumdisplay.php?f=95
-Crit