Author Topic: Ready made: PlaceBot  (Read 9611 times)

0 Members and 1 Guest are viewing this topic.

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Ready made: PlaceBot
« on: October 03, 2007, 12:41:03 pm »

6 Dummies placed around the coordinates of my gostek


Teh code...



function PlaceBot(botname: string; team: byte; X,Y: single): byte;

Parameters explain themselves. The function's result will return the ID of the placed bot.

« Last Edit: June 25, 2008, 05:34:17 am by Avarax »
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline Duck Boi

  • Soldier
  • **
  • Posts: 196
  • ('')('_')('')
Re: Ready made: PlaceBot
« Reply #1 on: October 03, 2007, 01:38:23 pm »
Meatshield script ;D? Nice.
But not that useful tbh..

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Ready made: PlaceBot
« Reply #2 on: October 03, 2007, 02:35:11 pm »
It's useful for other scripters, not server owners.
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline Ride

  • Soldier
  • **
  • Posts: 199
    • NA Soldat Clan Website
Re: Ready made: PlaceBot
« Reply #3 on: October 03, 2007, 02:58:58 pm »
Ah i see.. With all these scripts your doing. Will there be an update in Trenchwar Domination Script aswell?

I can only hope considering the only use for it right now is Public TW servers.
It isnt accurate to be used in clan wars..

Hope this isnt off topic

Nice Script
Ingame Name: TC ~ Ryde.Lf ~
Past Clans: ^Re/ ~ -eO:

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: Ready made: PlaceBot
« Reply #4 on: October 03, 2007, 06:41:08 pm »
hmmm... am I right to believe that "break;" stops a script from working with something?
could it be used like so:
Code: [Select]
...
var
  blah:boolean;
begin
...
  blah:=true;
  break;  //don't want anything to be done from this temporary change
    *do this*
  blah:=false;
...
  if blah = true do this
  *this will not be done because of break?*
end;
"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 DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Ready made: PlaceBot
« Reply #5 on: October 03, 2007, 07:15:56 pm »
hmmm... am I right to believe that "break;" stops a script from working with something?
could it be used like so:
Code: [Select]
...
var
  blah:boolean;
begin
...
  blah:=true;
  break;  //don't want anything to be done from this temporary change
    *do this*
  blah:=false;
...
  if blah = true do this
  *this will not be done because of break?*
end;
break stops a for or while loop from looping

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: Ready made: PlaceBot
« Reply #6 on: October 03, 2007, 07:53:08 pm »
then what stops something from going after a temp. change
"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 bulgaria

  • Major(1)
  • Posts: 5
Re: Ready made: PlaceBot
« Reply #7 on: October 03, 2007, 10:44:01 pm »
nice script

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Ready made: PlaceBot
« Reply #8 on: October 04, 2007, 06:28:56 am »
Use "exit;" to stop an entire procedure / function.
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline Kagesha

  • Flagrunner
  • ****
  • Posts: 702
  • cunts
Re: Ready made: PlaceBot
« Reply #9 on: October 04, 2007, 06:34:05 am »
This script is really awesome, a fun script to use.

Avarax any chance this maybe implemented in hexer as one of the spells?

Offline Aquarius

  • Soldier
  • **
  • Posts: 234
Re: Ready made: PlaceBot
« Reply #10 on: October 04, 2007, 06:55:39 am »
Cool. To bad we can't chage bot/player appearance via scripting...

Offline David2204

  • Major(1)
  • Posts: 21
  • They say he's coming... He's coming to kill you...
Re: Ready made: PlaceBot
« Reply #11 on: November 11, 2007, 08:26:51 am »
I edited the script a little, since there are too many ponchos when you type /test 3-4 times
It kicks all of them after a minute
Code: [Select]
function OnCommand(ID: Byte; Text: string): boolean;
begin
  If text = '/test' then begin
    PlaceBot('Poncho',GetPlayerStat(ID,'Team'),GetPlayerStat(ID,'X')+21,GetPlayerStat(ID,'Y'));
    PlaceBot('Poncho',GetPlayerStat(ID,'Team'),GetPlayerStat(ID,'X')+10,GetPlayerStat(ID,'Y')+18);
    PlaceBot('Poncho',GetPlayerStat(ID,'Team'),GetPlayerStat(ID,'X')-10,GetPlayerStat(ID,'Y')+18);
    PlaceBot('Poncho',GetPlayerStat(ID,'Team'),GetPlayerStat(ID,'X')+10,GetPlayerStat(ID,'Y')-18);
    PlaceBot('Poncho',GetPlayerStat(ID,'Team'),GetPlayerStat(ID,'X')-10,GetPlayerStat(ID,'Y')-18);
    PlaceBot('Poncho',GetPlayerStat(ID,'Team'),GetPlayerStat(ID,'X')-21,GetPlayerStat(ID,'Y'));
    sleep(60000);
    Command('/kick Poncho');
  end;
  Result := false;
end;

Thats all :)

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Ready made: PlaceBot
« Reply #12 on: November 11, 2007, 09:13:59 am »
I edited the script a little, since there are too many ponchos when you type /test 3-4 times
It kicks all of them after a minute
Code: [Select]
function OnCommand(ID: Byte; Text: string): boolean;
begin
  If text = '/test' then begin
    PlaceBot('Poncho',GetPlayerStat(ID,'Team'),GetPlayerStat(ID,'X')+21,GetPlayerStat(ID,'Y'));
    PlaceBot('Poncho',GetPlayerStat(ID,'Team'),GetPlayerStat(ID,'X')+10,GetPlayerStat(ID,'Y')+18);
    PlaceBot('Poncho',GetPlayerStat(ID,'Team'),GetPlayerStat(ID,'X')-10,GetPlayerStat(ID,'Y')+18);
    PlaceBot('Poncho',GetPlayerStat(ID,'Team'),GetPlayerStat(ID,'X')+10,GetPlayerStat(ID,'Y')-18);
    PlaceBot('Poncho',GetPlayerStat(ID,'Team'),GetPlayerStat(ID,'X')-10,GetPlayerStat(ID,'Y')-18);
    PlaceBot('Poncho',GetPlayerStat(ID,'Team'),GetPlayerStat(ID,'X')-21,GetPlayerStat(ID,'Y'));
    sleep(60000);
    Command('/kick Poncho');
  end;
  Result := false;
end;

Thats all :)
Your code will freeze up the server sense OnCommand is not threaded.

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Ready made: PlaceBot
« Reply #13 on: November 11, 2007, 09:54:13 am »
Well /test is only for testing purposes, it's not necessary for the actual script.
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline David2204

  • Major(1)
  • Posts: 21
  • They say he's coming... He's coming to kill you...
Re: Ready made: PlaceBot
« Reply #14 on: November 11, 2007, 04:06:56 pm »
Your code will freeze up the server sense OnCommand is not threaded.

I know and I like it that way! Since people can't spawn 20 packs of Ponchos at the same time... The only thing that bothers me is that if one person spawns Ponchos and after 15 seconds another person spawns Ponchos, then after 5 seconds both packs will be kicked... Any ideas how to solve this? Avarax?

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Ready made: PlaceBot
« Reply #15 on: November 11, 2007, 04:51:44 pm »
No comment o_O
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline Iq Unlimited

  • Flagrunner
  • ****
  • Posts: 864
  • mr. foobar2000
Re: Ready made: PlaceBot
« Reply #16 on: November 11, 2007, 07:43:13 pm »
Your code will freeze up the server sense OnCommand is not threaded.

I know and I like it that way! Since people can't spawn 20 packs of Ponchos at the same time... The only thing that bothers me is that if one person spawns Ponchos and after 15 seconds another person spawns Ponchos, then after 5 seconds both packs will be kicked... Any ideas how to solve this? Avarax?

Theres no way to stop bots with that name to not be kicked, you'd have to spawn the bots for another pack under a different name.

But, there is no way to stop bots from being kicked. you'd just have to name another pack of bots a different name.

Offline t3h_n00b

  • Major
  • *
  • Posts: 88
  • | Honor | Duty | Glory |
Re: Ready made: PlaceBot
« Reply #17 on: November 12, 2007, 06:07:09 am »
With a swat mod,it would be fucking omfgling awesome,comrade.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Ready made: PlaceBot
« Reply #18 on: November 12, 2007, 06:33:46 am »
Your code will freeze up the server sense OnCommand is not threaded.

I know and I like it that way! Since people can't spawn 20 packs of Ponchos at the same time... The only thing that bothers me is that if one person spawns Ponchos and after 15 seconds another person spawns Ponchos, then after 5 seconds both packs will be kicked... Any ideas how to solve this? Avarax?
Doing Command('/addbot...') returns the bot's ID... if you store the ID into an array or something, you can then kick only those IDs when you want to, and not the other ones you don't want.

Offline David2204

  • Major(1)
  • Posts: 21
  • They say he's coming... He's coming to kill you...
Re: Ready made: PlaceBot
« Reply #19 on: November 12, 2007, 07:30:13 am »
Great idea, but I dont think I know Pascal enough to do it.... well... i can give it a shot, but it aint a promise ;D