PtokaX forum

Development Section => HOW-TO's => Topic started by: (Mr420) on 11 October, 2003, 01:18:24

Title: Giving A Bot A Description
Post by: (Mr420) on 11 October, 2003, 01:18:24
This Will Allow A Bot To Have A Description. Just add the my_info_string = blah to the function Main() of the script. If it doesn't have one, use the one provided.
--//Bot Description For Any Bot
--//Mr420

botname = "blah"
bot_email = "blah"
bot_speed = "blah"
bot_descr = "blah"
bot_share_size = 420.01 * 1024 *1024
my_info_string = "$MyINFO $ALL "..botname.." "..bot_descr.."$ $"..bot_speed..strchar( 1 ).."$"..bot_email

function Main()
frmHub:RegBot(botname)
my_info_string = "$MyINFO $ALL "..botname.." "..bot_descr.."$ $"..bot_speed..strchar( 1 ).."$"..bot_email..
"$"..bot_share_size.."$"
end

function NewUserConnected(curUser)
curUser:SendData( my_info_string )
end

function OpConnected(curUser)
curUser:SendData( my_info_string )
end  

Enjoy!!

/(Mr420)
Title: ...
Post by: WENS on 11 October, 2003, 03:11:40
:D  :P  :D
Title:
Post by: ptaczek on 11 October, 2003, 13:51:41
Does it work also for userlist refresh? ;)
Title:
Post by: piglja on 11 October, 2003, 14:10:58
Ptaczek, nope;)

It is not, then in the script must be a line which removes it on script start:)
Title:
Post by: pHaTTy on 11 October, 2003, 17:40:38
add SendToAll to main function



function Main()
frmHub:RegBot(botname)
my_info_string = "$MyINFO $ALL "..botname.." "..bot_descr.."$ $"..bot_speed..strchar( 1 ).."$"..bot_email..
"$"..bot_share_size.."$"
SendToAll( my_info_string )

end



l8rr,,


-phatty
Title: thanks
Post by: (Mr420) on 12 October, 2003, 12:20:41
thanks for the SendToAll phatty. Didn't think of that...hehe  
 
;)

/(Mr420)
Title:
Post by: pHaTTy on 12 October, 2003, 14:00:23
yw :o)
Title:
Post by: Skrollster on 16 October, 2003, 18:15:22
QuoteOriginally posted by ptaczek
Does it work also for userlist refresh? ;)

Yes it does =)

it will keep the old info as long as the client doesn't get any new info about the bot/user
Title:
Post by: NightLitch on 26 October, 2003, 19:32:40
This is good... now my bot will not look so, "pale" :-)
Title:
Post by: enigma on 04 November, 2005, 05:39:36
can i show a tag for the bot ?
i edited the above ..
botname = "XXX"
bot_email = ""
bot_speed = ""
bot_descr = ""
bot_share_size = XXXXX.XX * 1024 *1024
my_info_string = "$MyINFO $ALL "..botname.." "..bot_descr.."$ $"..bot_speed.."$"..bot_email
function Main()
frmHub:RegBot(botname)
my_info_string = "$MyINFO $ALL "..botname.." "..bot_descr.."$ $"..bot_speed.."$"..bot_email..
"$"..bot_share_size.."$"
SendToAll( my_info_string )
end
function NewUserConnected(curUser)
curUser:SendData( my_info_string )
end
function OpConnected(curUser)
curUser:SendData( my_info_string )
end

i got some error as strchr something..jus removed  the strchr part and working as i wanted
regarding tag some1 help pls.
Title:
Post by: bastya_elvtars on 04 November, 2005, 10:32:47
Bot description is built into the API now.

See this (http://ptxwiki.psycho-chihuahua.net/doku.php/scriptinghelp/ptokaxapi#regbot_botname_isop_description_email).
Title:
Post by: (-=TrIp-iN-SuN=-) on 04 November, 2005, 11:06:05
i get error
Syntax [string "--//Bot Description For Any Bot
..."]:9: attempt to call global `strchar' (a nil value)
Title:
Post by: bastya_elvtars on 04 November, 2005, 11:59:18
QuoteOriginally posted by (-=TrIp-iN-SuN=-)
i get error
Syntax [string "--//Bot Description For Any Bot
..."]:9: attempt to call global `strchar' (a nil value)

*shits himself in the face*

BTW you just have to replace strchar to string.char if you eagerly wanna use that solution. ;)
Title:
Post by: enigma on 04 November, 2005, 17:59:56
i jus removed the strchr part and lol the script is working ...see tats wat i edited in my posted script...lolol
Title:
Post by: enigma on 05 November, 2005, 22:18:11
QuoteOriginally posted by bastya_elvtars
Bot description is built into the API now.

See this (http://ptxwiki.psycho-chihuahua.net/doku.php/scriptinghelp/ptokaxapi#regbot_botname_isop_description_email).

umm ..i tried to understand tat , but cant get mych out of it :(

maybe some1 posts me the code :)
Title:
Post by: DJ Bert on 05 November, 2005, 23:15:04
This is what i use and works fine.
--bot info
botname = "Guardian"
botemail = "guardianlua5@walla.com"
bottag = "<++ K:W.4711,M:A,H:1/0/6,S:1>"
botspeed = "-GIII-"
botdescr = "Guardian 5 V1.5 by Guardian Team"
botsharesize = 17 * 1024 * gb + 1024 * 1024 * 285
frmHub:RegBot(botname, Reg)
botinfostring = "$MyINFO $ALL "..botname.." "..botdescr.." "..bottag.."$ $"..botspeed.."$"..botemail.."$"..botsharesize.."$"

function Main()
SendToAll("( >>>>  Guardian 5 v.1.5 - Made by Guardianteam? Started at "..os.date(" the %A %d-%m-%Y at %X ").."  <<<< )")
end

function NewUserConnected(curUser)
curUser:SendData(botinfostring)
end

function OpConnected(curUser)
curUser:SendDatabotinfostring)
end



Grtzzz

DJ Bert
Title:
Post by: bastya_elvtars on 05 November, 2005, 23:55:26
If a bot has a connection, recent client implementations (and Hub-Link) will handle it as a regular user. So, away messages will be sent to it, etc.
The way PtokaX does it gives no connection to the bot, so every client knows it's a bot, not a user.