Author Topic: Ready made: PlaceBot  (Read 9610 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

Offline KwS Pall

  • Major(1)
  • Posts: 49
  • I'm going to write Tibia for Soldat
Re: Ready made: PlaceBot
« Reply #20 on: November 12, 2007, 10:15:25 am »
Code: [Select]
var
bots : array[1..6] of byte;
begin
bots[1] := PlaceBot('Poncho',GetPlayerStat(ID,'Team'),GetPlayerStat(ID,'X')+21,GetPlayerStat(ID,'Y'));
bots[2] := PlaceBot('Poncho',GetPlayerStat(ID,'Team'),GetPlayerStat(ID,'X')+10,GetPlayerStat(ID,'Y')+18);
bots[3] := PlaceBot('Poncho',GetPlayerStat(ID,'Team'),GetPlayerStat(ID,'X')-10,GetPlayerStat(ID,'Y')+18);
bots[4] := PlaceBot('Poncho',GetPlayerStat(ID,'Team'),GetPlayerStat(ID,'X')+10,GetPlayerStat(ID,'Y')-18);
bots[5] := PlaceBot('Poncho',GetPlayerStat(ID,'Team'),GetPlayerStat(ID,'X')-10,GetPlayerStat(ID,'Y')-18);
bots[6] := PlaceBot('Poncho',GetPlayerStat(ID,'Team'),GetPlayerStat(ID,'X')-21,GetPlayerStat(ID,'Y'));
end;
I'm going to write Tibia for Soldat

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Ready made: PlaceBot
« Reply #21 on: November 12, 2007, 10:31:55 am »
Anyways... I guess you guys are missing the point of this code snippet.
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline lewymati

  • Major(1)
  • Posts: 38
Re: Ready made: PlaceBot
« Reply #22 on: June 23, 2008, 08:27:53 am »
:E
i'd like to take a look at this but...


"Not Found

The requested document was not found."

if some1 has that code plz send it somewhere :>

Offline danmer

  • Camper
  • ***
  • Posts: 466
  • crabhead
Re: Ready made: PlaceBot
« Reply #23 on: June 23, 2008, 09:12:11 am »
:E
i'd like to take a look at this but...


"Not Found

The requested document was not found."

if some1 has that code plz send it somewhere :>
this should be it: http://nopaste.org/p/ak4udcFOk
(copied from mmod)

Offline shantec

  • Soldier
  • **
  • Posts: 140
  • Get ANGREH!!
Re: Ready made: PlaceBot
« Reply #24 on: June 24, 2008, 06:18:02 am »
[offtopic]
I've noticed that many (if not all) Avarax's "Ready Made" scripts have been removed from notepaste :S
Well, luckily at least few guys here, at soldatforums, has them all. Point of this stupid post was nothing, and my intention wasn't to insult anyone. If you however feel insulted, please, tell it to hand. Hand will listen you  [retard]
[/offtopic]
Also Known As REIMA


Lol Happles (happy apples)

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Ready made: PlaceBot
« Reply #25 on: June 24, 2008, 12:16:40 pm »
[offtopic]
I've noticed that many (if not all) Avarax's "Ready Made" scripts have been removed from notepaste :S
Well, luckily at least few guys here, at soldatforums, has them all. Point of this stupid post was nothing, and my intention wasn't to insult anyone. If you however feel insulted, please, tell it to hand. Hand will listen you [retard]
[/offtopic]
There is a point to what you are saying, don't completely rely on nopaste or any other paste sites.

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: Ready made: PlaceBot
« Reply #26 on: June 30, 2008, 08:52:50 pm »
ok i have read the code, but it doesnt include any commands to do it o_0 either i am utterly confused or missing the point
what are the commands?
and can u plz put this in a zip file?
« Last Edit: June 30, 2008, 08:55:04 pm by frosty »
check out my server! click here

If at first you don't succeed, Improvise! :D

Offline Iq Unlimited

  • Flagrunner
  • ****
  • Posts: 864
  • mr. foobar2000
Re: Ready made: PlaceBot
« Reply #27 on: June 30, 2008, 11:20:52 pm »
frosty: it's a function to be implimented into your script, not a command or anything.

Offline Dark Dragon DX

  • Major(1)
  • Posts: 11
  • My Logo
    • My Library Of Files
Re: Ready made: PlaceBot
« Reply #28 on: July 15, 2008, 07:06:01 pm »
Now, unless it doesn't work on dedicated servers, everytime I use placebot in any way [PlaceBot('Poncho',GetPlayerStat(ID,'Team'),GetPlayerStat(ID,'X')+21,GetPlayerStat(ID,'Y'));] just like in the brackets, my server won't start.

Nevermind, I just started coding. I forgot to paste the code into my script file.   [retard]
« Last Edit: July 15, 2008, 07:09:07 pm by Dark Dragon DX »
Dark Dragon DX[/I]
My Library Of Files

Offline BondJamesBond

  • Flagrunner
  • ****
  • Posts: 986
    • http://tobylands.com
Re: Ready made: PlaceBot
« Reply #29 on: August 07, 2008, 02:49:17 am »
Hi, this is a great script. I changed it just lil' bit so the bots can't be added from ingame - and instead get added through the script.

But I have a problem of the bots warping when they are placed in a waypointed map. They try to jump, but just end up warping back to their spot for spawn.

Occasionally, one of 'em will break free... :(

Any reason for this? The server has survival mode on as well.
The computer is a moron.
?  - Peter Drucker

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: Ready made: PlaceBot
« Reply #30 on: December 04, 2008, 11:28:12 am »
Code: [Select]
function PlaceBot(botname: string; team: byte; X,Y: single): byte;
var i,n,tempType: byte;
    spawn: array of byte;
    tempX,tempY: single;
begin
  SetArrayLength(spawn,0);
  n:=0;
  for i:=1 to 254 do
    If GetSpawnStat(i,'Active') = true then
      If GetSpawnStat(i,'Style') = team then begin
        n:=n + 1;
        SetArrayLength(spawn,n);
        spawn[n-1]:=i;
        SetSpawnStat(i,'Active',false);
      end;
  for i:=1 to 254 do
    If GetSpawnStat(i,'Active') = false then begin
      SetSpawnStat(i,'Active',true);
      tempType:=GetSpawnStat(i,'Style');
      tempX:=GetSpawnStat(i,'X');
      tempY:=GetSpawnStat(i,'Y');
      SetSpawnStat(i,'Style',team);
      SetSpawnStat(i,'X',X);
      SetSpawnStat(i,'Y',Y);
      break;
    end;
  result:=Command('/addbot' + inttostr(team) + ' ' + botname);
  SetSpawnStat(i,'Active',false);
  SetSpawnStat(i,'Style',tempType);
  SetSpawnStat(i,'X',tempX);
  SetSpawnStat(i,'Y',tempY);
  If n > 0 then
    for i:=0 to n-1 do
      SetSpawnStat(spawn[i],'Active',true);
end;

I copied this from MMod.