Official Soldat Forums

Server Talk => Scripting Releases => Topic started by: skrX on August 18, 2013, 05:23:14 am

Title: Trollscript
Post by: skrX on August 18, 2013, 05:23:14 am
Script Name: Trollscript
Script Description: script allows to write for someone / botchat
Author: skrX
Core Version: 2.7.6

/troll ID TEXT - to write someone e.g /troll 1 asd

/copy ID - to select a random text


Enjoy! :)

Title: Re: AdminSpeak
Post by: Vos on August 18, 2013, 09:19:14 am
this only triggers the /say function for me
Title: Re: AdminSpeak
Post by: Bonecrusher on August 18, 2013, 03:55:57 pm
Been using script like this for a while and I always have a good laugh how confused some players are
Title: Re: AdminSpeak
Post by: Vos on August 18, 2013, 04:49:28 pm
for me it works awesome, i just changed /sayto to /trollplayer xD

Ah right, im going to try it out then
Title: Re: trollscript
Post by: skrX on March 23, 2014, 07:01:06 am
up
Title: Re: trollscript
Post by: Drax on March 23, 2014, 01:49:26 pm
it's a good thing for admins, a way to punish bad players :) good job
Title: Re: Trollscript
Post by: AntyMan on August 21, 2014, 03:55:43 pm
Code: [Select]
{        _                         
     ___| | ___ ____  __
    / __| |/ / '__\ \/ /
    \__ \   <| |   >  <
    |___/_|\_\_|  /_/\_\

by skrX
}

var
  TypeArray: TStringarray;

function Explode(Source: string; const Delimiter: string): array of string;
var
  Position, DelLength, ResLength: integer;
begin
  DelLength := Length(Delimiter);
  Source := Source + Delimiter;
  repeat
    Position := Pos(Delimiter, Source);
    SetArrayLength(Result, ResLength + 1);
    Result[ResLength] := Copy(Source, 1, Position - 1);
    ResLength := ResLength + 1;
    Delete(Source, 1, Position + DelLength - 1);
  until (Position = 0);
  SetArrayLength(Result, ResLength - 1);
end;

function OnCommand(ID: byte; Text: string): boolean;
var
  randomtext: integer;
  buffer: string;
  i: integer;
begin

  Result := false;
 
  buffer := '';
  TypeArray := Explode(Text, ' ');
 
case TypeArray[0] of

'/troll','/says','chat':

if ArrayHigh(TypeArray) >= 2 then begin
for i := 2 to ArrayHigh(TypeArray) - 1 do begin
   buffer := buffer + TypeArray[i] + ' ';
end;
buffer := buffer + TypeArray[ArrayHigh(TypeArray)];
BotChat(strtoint(TypeArray[1]), buffer);

//to be able to use the commands
//OnPlayerSpeak(strtoint(TypeArray[1]), buffer);
end;
end;
end;

So it is not simpler?
Code: [Select]
if MaskCheck(LowerCase(Text),'/troll *') then begin
BotChat(strtoint(GetPiece(Text,' ',1)), Copy(Text,10,Length(Text)));
end;