Author Topic: possible kickbot script (no work yet)  (Read 1451 times)

0 Members and 1 Guest are viewing this topic.

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
possible kickbot script (no work yet)
« on: August 21, 2007, 10:24:31 pm »
If anyone can get this kickbot script to work I would be happy to let ANYONE use it

if we can get it to work...
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: possible kickbot script (no work yet)
« Reply #1 on: August 21, 2007, 10:29:17 pm »
That has to be the worst attempt at coding I have ever seen..

doing "then end;" does not exit the code section, it just ends that conditional... And learn2loop... Use the for i := 1 to 32 loop

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: possible kickbot script (no work yet)
« Reply #2 on: August 21, 2007, 11:00:29 pm »
LOL! Like enesce said the "then end;" does nothing. Also all text from onCommand begins with a /

Fixed script:

Code: [Select]
function OnCommand(ID:Byte;Text:string):boolean;
var
i: byte;
begin
result := false
if (Text = '/botbgone') then for i:=1 to 32 do if GetPlayerStat(ID,'Human') = false then KickPlayer(ID);
end;

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: possible kickbot script (no work yet)
« Reply #3 on: August 21, 2007, 11:21:31 pm »
thanx, now anyone who wants it can have it

EDIT::: nevermind, soldat was open when I started soldatserver

Date Posted: August 22, 2007, 12:09:41 AM
hey EnEsCe, you should make a function that automatically kicks bots, and a function that deletes maps from the map list

function KickBots(ID: Byte); //(ID to 0 to kick all bots)
function DelMaps(Similar: string);
function AddMaps(Similar: string);
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: possible kickbot script (no work yet)
« Reply #4 on: August 21, 2007, 11:22:41 pm »
KickBots is dumb.
DelMaps already exists. Command('/delmap Arena');
AddMaps already exists. Command('/addmap Arena');

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: possible kickbot script (no work yet)
« Reply #5 on: August 21, 2007, 11:31:48 pm »
I mean deletes or adds all maps with (example:) ctf in their name or all without ctf in their name
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline Toumaz

  • Veteran
  • *****
  • Posts: 1904
Re: possible kickbot script (no work yet)
« Reply #6 on: August 22, 2007, 12:10:17 am »
Just read the maps from mapslist.txt, rip out the ones you want, write them back, /loadlist mapslist.

Offline BurnedKirby

  • Major(1)
  • Posts: 39
Re: possible kickbot script (no work yet)
« Reply #7 on: August 24, 2007, 04:24:58 pm »
Would the script work if I changed "KickPlayer(ID);" to "KillPlayer(ID);" ?

Offline Toumaz

  • Veteran
  • *****
  • Posts: 1904
Re: possible kickbot script (no work yet)
« Reply #8 on: August 24, 2007, 04:42:11 pm »
There's no function called KillPlayer(), what you'd want to do instead is Command('/kill '+inttostr(ID));.

Offline BurnedKirby

  • Major(1)
  • Posts: 39
Re: possible kickbot script (no work yet)
« Reply #9 on: August 24, 2007, 07:06:39 pm »
That code wont work... I doubt the command thing works in this script.


Offline BurnedKirby

  • Major(1)
  • Posts: 39
Re: possible kickbot script (no work yet)
« Reply #11 on: August 25, 2007, 11:38:09 am »
I have tried it. It wouldn't work. In soldat, the command wont work, and in the Admin program I'm using, it says
 
  • [Error] botkiller -> (OnCommand): Invalid variant operation

(The name of the script folder is botkiller.)
I used the same exact script posted above, and changed the command to kill instead of kick as posted by Toumaz.
« Last Edit: August 25, 2007, 11:39:50 am by BurnedKirby »

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: possible kickbot script (no work yet)
« Reply #12 on: August 25, 2007, 11:41:49 am »
You need to do:
if (Text = '/botbgone') then for i:=1 to 32 do if GetPlayerStat(i,'Active') = true then if GetPlayerStat(i,'Human') = false then KickPlayer(i);

I'm not sure if this would bring up an error but it might, but its the "if _ and _" instead of "if _ then if _ then _" which is the way that i know won't bring the 1 error

if (Text = '/botbgone') then for i:=1 to 32 do if (GetPlayerStat(i,'Active') = true) and (GetPlayerStat(i,'Human') = false) then KickPlayer(i);

Offline BurnedKirby

  • Major(1)
  • Posts: 39
Re: possible kickbot script (no work yet)
« Reply #13 on: August 25, 2007, 12:02:51 pm »
Thanks, that finally fixed the problem.