Remove Bot from Hub using a cmd!
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Remove Bot from Hub using a cmd!

Started by EXNET OWNER, 03 September, 2004, 00:26:01

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

EXNET OWNER

I need a part of script that will allow me to remove a bot from the hub on demand using the +unregbot command... I dont know if this is possible. Could someone please help

Thanks,

By the way AnarchyBot is under construction, this is what i need the script for, I have all right click functions available and I now have someone working on the v1.0 GUI

nErBoS

#1
Hi,

You want to remove or to unreg is name ???

Best regards, nErBoS
--## nErBoS Spot ##--

Herodes

#2
I think you had this one EXNET ... but this tiime I edited a bit further to accomodate the remove funciton :)

--- ChangeInfo ... by EXNET OWNER
--- altered by Herodes ... 12/08 - 2004 
--------------------------------------------------------------------------------------
--- allows to change the info of the bot ...
--- It can change the following :
--- --- Name / Description / Connection /...
--- --- Version / Mode / OpHubs / RegHubs /...
--- --- GuestHubs / Slots / Email / Share
--- Added right click menu for easy access :))) (thx for the idea EXNET :)
--- Added ability to remove a bot from the userlist... (  ' Removercmd ' variable )+ rightclick is there ... :)
--------------------------------------------------------------------------------------
WhoCan = "Herodes"
ChangeCmd = "+alter"
Removercmd = "+remove"
--------------------------------------------------------------------------------------
BotName = "-???OwL???-"
Description = "Yes I use a modified client, No I don't have a tag, BIG FUCKIN DEAL!"
Connection = "DSL"
Version = "0.403"
Mode = "A"
HubsOp = "1"
HubsReg = "0"
HubsGuest = "0"
Slots = "3"
Tag = "<++ V:"..Version..",M:"..Mode..",H:"..HubsGuest.."/"..HubsReg.."/"..HubsOp..",S:"..Slots..">"
Email = "None"
Share = 6958739042 -- In Bytes not KB, MB or GB
--------------------------------------------------------------------------------------


function Main()
Bot_sMyInfoString = "$MyINFO $ALL "..BotName.." "..Description..Tag.."$ $"..Connection.."$"..Email.."$"..Share.."$|"
	RegTheBot(BotName)
end

function OpConnected(user)
	if user.sName == WhoCan then
		local tRCs = {
				"$UserCommand 0 7|",
				"$UserCommand 1 2 Change BotInfo\\Name $<%[mynick]> "..ChangeCmd.." name %[line: New Name for the Bot?]|",
				"$UserCommand 1 2 Change BotInfo\\Description $<%[mynick]> "..ChangeCmd.." name %[line: New Name for the Bot?]|",
				"$UserCommand 1 2 Change BotInfo\\Connection $<%[mynick]> "..ChangeCmd.." con %[line: Change the connection of the Bot?]|",
				"$UserCommand 1 2 Change BotInfo\\Tag\\Version $<%[mynick]> "..ChangeCmd.." tag v %[line: Change the Version in the tag of the Bot?]|",
				"$UserCommand 1 2 Change BotInfo\\Tag\\Mode $<%[mynick]> "..ChangeCmd.." tag m %[line: Change the Mode in the tag of the Bot?]|",
				"$UserCommand 1 2 Change BotInfo\\Tag\\Hubs\\Guest $<%[mynick]> "..ChangeCmd.." tag hg %[line: Change the number of Guest Hubs in the tag?]|",
				"$UserCommand 1 2 Change BotInfo\\Tag\\Hubs\\Reg $<%[mynick]> "..ChangeCmd.." tag hr %[line: Change the number of Reg Hubs in the tag?]|",
				"$UserCommand 1 2 Change BotInfo\\Tag\\Hubs\\Oper $<%[mynick]> "..ChangeCmd.." tag ho %[line: Change the number of Op Hubs in the tag?]|",
				"$UserCommand 1 2 Change BotInfo\\Tag\\Slots $<%[mynick]> "..ChangeCmd.." tag s %[line: Change the number of Slots in the tag?]|",
				"$UserCommand 1 2 Change BotInfo\\Email $<%[mynick]> "..ChangeCmd.." tag s %[line: Change the Bot's Email?]|",
				"$UserCommand 1 2 Change BotInfo\\Share $<%[mynick]> "..ChangeCmd.." tag s %[line: Change Bot's Share?]|",
				"$UserCommand 1 2 Change BotInfo\\Remove Bot $<%[mynick]> "..Removercmd.." %[line: which bot to remove ?]|",
				};
		for i , v in tRCs do
			user:SendData(tRCs[i])
		end
		user:SendData("InfoChanger", "The right click for changing the properties of the bot is there .. :)")
	end
end
				
function DataArrival(user, data)
	if ( user.bOperator and (user.sName == WhoCan) ) then
	data = strsub(data,1,strlen(data)-1)
	_,_,cmd, what, arg = strfind(data, "%b<>%s+(%S*)%s(%S+)%s(.*)")
		if cmd == ChangeCmd then
			if ( (what ~= nil or what ~= "") and ( arg ~= nil or arg ~= "") ) then
				if what == "desc" then
					Description = arg 
					Bot_sMyInfoString = "$MyINFO $ALL "..BotName.." "..Description..Tag.."$ $"..Connection.."$"..Email.."$"..Share.."$|"
					RegTheBot(BotName)
					return 1
				elseif what == "con" then 
					Connection = arg
					Bot_sMyInfoString = "$MyINFO $ALL "..BotName.." "..Description..Tag.."$ $"..Connection.."$"..Email.."$"..Share.."$|"
					RegTheBot(BotName)
					return 1
				elseif what == "email" then 
					Email = arg
					Bot_sMyInfoString = "$MyINFO $ALL "..BotName.." "..Description..Tag.."$ $"..Connection.."$"..Email.."$"..Share.."$|"
					RegTheBot(BotName)
					return 1
				elseif what == "tag" then
					s,e,que = strfind(arg, "(%S+)")
						if que == "v" then
							s,e,num = strfind(arg , "%S+%s(%d+%.%d+)")
							if num then
							Tag = "<++ V:"..num..",M:"..Mode..",H:"..HubsGuest.."/"..HubsReg.."/"..HubsOp..",S:"..Slots..">"
							else user:SendData("InfoChangeError", "The version has to be in the form of #.### where # is a number ...")
							end
						elseif que == "m" then
							s,e,mod = strfind(arg, "%S+%s(%S)")
							if mod then
							Tag = "<++ V:"..Version..",M:"..mod..",H:"..HubsGuest.."/"..HubsReg.."/"..HubsOp..",S:"..Slots..">"
							end
						elseif que == "ho" then
							s,e,ho = strfind(arg, "%S+%s(%d+)")
							if ho then
							Tag = "<++ V:"..Version..",M:"..Mode..",H:"..HubsGuest.."/"..HubsReg.."/"..ho..",S:"..Slots..">"
							else user:SendData("InfoChangeError", "The Operator Hubs value needs to be a number....")
							end
						elseif que == "hr" then
							s,e,hr = strfind(arg, "%S+%s(%d+)")
							if hr then
							Tag = "<++ V:"..Version..",M:"..Mode..",H:"..HubsGuest.."/"..hr.."/"..HubsOp..",S:"..Slots..">"
							else user:SendData("InfoChangeError", "The Registered Hubs value needs to be a number....")
							end
						elseif que == "hg" then
							s,e,hg = strfind(arg, "%S+%s(%d+)")
							if hg then
							Tag = "<++ V:"..Version..",M:"..Mode..",H:"..hg.."/"..HubsReg.."/"..HubsOp..",S:"..Slots..">"
							else user:SendData("InfoChangeError", "The Guest Hubs value needs to be a number....")
							end
						elseif que == "s" then
							s,e,sl = strfind(arg, "%S+%s(%d+)")
							if sl then
							Tag = "<++ V:"..Version..",M:"..Mode..",H:"..HubsGuest.."/"..HubsReg.."/"..HubsOp..",S:"..sl..">"
							else user:SendData("InfoChangeError", "The Slots value needs to be a number....")
							end
						else 
							local msg = "Please use the tag change as follows :\r\n"
									msg = msg.."\t - "..ChangeCmd.." tag v \t\tchanges the version\r\n"
									msg = msg.."\t - "..ChangeCmd.." tag m \tchanges the mode\r\n"
									msg = msg.."\t - "..ChangeCmd.." tag ho \tchanges the number of Operator Hubs\r\n"
									msg = msg.."\t - "..ChangeCmd.." tag hr \t changes the Registered Hubs\r\n"
									msg = msg.."\t - "..ChangeCmd.." tag hg \tchanges the number of Guest Hubs\r\n"
									msg = msg.."\t - "..ChangeCmd.." tag s \tchanges the slots number"
							user:SendData("InfoChangeError", msg)
							return 1 
						end
					Bot_sMyInfoString = "$MyINFO $ALL "..BotName.." "..Description..Tag.."$ $"..Connection.."$"..Email.."$"..Share.."$|"
					RegTheBot(BotName)
					return 1
				elseif what == "name" then
					s,e,arg = strfind(arg, "(%S+)")
					 UnregTheBot(BotName)
					BotName = arg
					Bot_sMyInfoString = "$MyINFO $ALL "..BotName.." "..Description..Tag.."$ $"..Connection.."$"..Email.."$"..Share.."$|"
					RegTheBot(BotName)
					return 1
				elseif what == "share" then
					if strfind(arg, "%d+") then
						Share = arg	
						Bot_sMyInfoString = "$MyINFO $ALL "..BotName.." "..Description..Tag.."$ $"..Connection.."$"..Email.."$"..Share.."$|"
						RegTheBot(BotName)
					else 
						user:SendData("InfoChangeError", "the share has to be in numbers .... and only numbers ...")
					end
					return 1
				else user:SendData("InfoChangeError", "please use one of the following : desc / name / con / email / share ")
				end

			end
			--- SendToAll("InfoChage", BotName.." "..Description.." "..Tag.." "..Connection.." "..Email.." "..Share)
		elseif cmd == Removercmd then
			UnregTheBot(what)
		end
	end
end

function UnregTheBot(Bot)
	frmHub:RegBot(Bot)
	frmHub:UnregBot(Bot)
end

function RegTheBot(Bot)
	frmHub:UnregBot(Bot)
	SendToAll (Bot_sMyInfoString)
	frmHub:RegBot(Bot)
end

EXNET OWNER

i am workin on summin else now m8, i have most of it done but i want a command that will unreg the bots name from the hub, so it looks like the bot left the hub... b quite funny LOL

Herodes

Talking about forum-jam here ... this thread has 3 posts per minute :) lol

SMF spam blocked by CleanTalk