Server Help

Bot Questions - Programmers

toKed - Tue Feb 01, 2005 9:52 pm
Post subject: Programmers
I will put this as simple and direct as possible

CypherJF is busy SSCC Omega Fire needs bots pm me in game if interested.......toKed
SamHughes - Tue Feb 01, 2005 10:07 pm
Post subject:
(Comment removed.)
Bak - Tue Feb 01, 2005 11:16 pm
Post subject:
Perhaps you could give a small description of what kind of a bot is needed.
toKed - Tue Feb 01, 2005 11:51 pm
Post subject:
Okay this is basicaly riped off of twbot's "standard module" but needed in merv. Im not much of a programmer but i know tw is java and merv is C++ i duno how hard it is to make it work out. Besides that cypher is gunna edit the Elim source once i get my hands on it. If i knew howto make tw-core work i would just use that but im illiterate to anything outside html


--------setships-------
!setship #-sets the ship to # 1-8 of all players
!setfreqship # #-the first # is the freq the second # is the ship
--------warp---------
!warp -just prizes a warp to everyone
!warpfreq # x y-warps freq # to certain x y coords
!warpall x y-warps everyone to certain x y coord
--------spec----
!autospec-well we all know what it does but i would like it in this category
!specplayer name #-specs specific player at # of deaths
!specfreq # #-specds a frq # at a number of deaths
-----freq------
!random #-if set !random 1 it makes everyone solo !random 2 makes teams of 2 ect.. to make it have teams of 2 say there 30 ppl you !random 15
Bak - Wed Feb 02, 2005 7:30 pm
Post subject:
Here's your completed bot with source, hope it works.
toKed - Wed Feb 02, 2005 9:42 pm
Post subject:
ty man if u ever need some help with other shit look me up in ssc
50% Packetloss - Wed Feb 02, 2005 10:52 pm
Post subject:
Just some programming tips (I had nothing better to do and I dont want to do calculus homwork):

1. Dont use the String class all over the place, especially in places where you are looping through every player, example from the above bot: sendPrivate(parse->item,"*setship " + (String)num);
For every player it will need to remake that string, you can do this with just a character array. Ex: char msg[]="*setship ";(2 spaces, the forum cut them out)
msg[7]=num | 0x30; //i think its 30 hex, im too lazy to look it up.
Of course you need to make sure the ship number is between 1 and 8, which you did. Overall I recommend sprintf over the string class.

2. No return; in the middle of functions, ever.

3. sendPublic("*prize #" + (String)PRIZE_Warp);//thats just plain lazy

Ive never been a fan of player_tags but whever works.
D1st0rt - Wed Feb 02, 2005 11:26 pm
Post subject:
http://botguide.blarglefish.com details how to set up a TWCore
Bak - Thu Feb 03, 2005 2:09 am
Post subject:
Is there a sprintnf function that takes a maximum buffer length in addition to a char* and format string?
Solo Ace - Thu Feb 03, 2005 2:18 am
Post subject:
You mean snprintf?
Or for Windows, _snprintf?
toKed - Thu Feb 03, 2005 3:18 pm
Post subject:
lol that bot was so buggy
toKed - Thu Feb 03, 2005 3:19 pm
Post subject:
ew sry for the double post forgot to mention O'shovah fixed the bugs
CypherJF - Thu Feb 03, 2005 3:27 pm
Post subject:
Plugin.
Cyan~Fire - Thu Feb 03, 2005 4:23 pm
Post subject:
50% wrote:
msg[7]=num | 0x30; //i think its 30 hex, im too lazy to look it up.

Just do "msg[7] = '0' + num;" or something.
Bak - Thu Feb 03, 2005 4:44 pm
Post subject:
toKed wrote:
lol that bot was so buggy


what were the bugs?
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group