My Bot
 

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

My Bot

Started by Woodster, 09 March, 2004, 23:52:49

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Woodster

--//Welcome Bot - Used from LUA FORUMS - Adapted and modifed by Woody for -=MSI=- by Woody
sBotName = "Bot_Name" 

frmHub:RegBot(sBotName) 

function GetOnline(pro)
local user,t = GetUsersByProfile(pro),0
	for index,val in user do
		if GetItemByName(user) then
		t = t + 1
		end
	end
	return t
end

function OpConnected(user) 
local i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)%$$") 
usershare = format("%0.2f", tonumber(share)/(1024*1024*1024)) 

local tmp 
tmp = "Welcome to "..frmHub:GetHubName().."\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? Your Nick: "..user.sName.."\r\n" 
tmp = tmp.."\t??? Your IP: "..user.sIP.."\r\n" 
tmp = tmp.."\t??? Your share: "..usershare.."GB\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? Hub Name: "..frmHub:GetHubName().."\r\n" 
tmp = tmp.."\t??? Hub Address: ....\r\n" 
tmp = tmp.."\t??? Hub Desc: "..frmHub:GetHubDescr().."\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? The Hub Cmd's >>> type !help and !rules. Please Read and Abide by them! \r\n" 
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Masters Online: "..GetOnline("Master").."\r\n" 
tmp = tmp.."\t??? Operators Online: "..GetOnline("Operator").."\r\n" 
tmp = tmp.."\t??? VIPs Online: "..GetOnline("VIP").."\r\n" 
tmp = tmp.."\t??? REGs Online: "..GetOnline("Reg").."\r\n" 
tmp = tmp.."\ \r\n" 

user:SendPM(sBotName,tmp) 
end 


--function NewUserConnected(user) 
-- local i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)%$$") 
-- usershare = format("%0.2f", tonumber(share)/(1024*1024*1024)) 

function NewUserConnected(user) 
i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)$") 
-- this if routine is checking so if the share cannot be extracted , shre equals to zero. and 
-- prevents nil / 1024 * 1024 * 1024 (which are causing the error) 
if share == nil then 
share = 0 
end 
usershare = format("%0.2f", tonumber(share)/(1024*1024*1024)) 

local tmp 
tmp = "Welcome to "..frmHub:GetHubName().."\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? Your Nick: "..user.sName.."\r\n" 
tmp = tmp.."\t??? Your IP: "..user.sIP.."\r\n" 
tmp = tmp.."\t??? Your share: "..usershare.."GB\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? Hub Name: "..frmHub:GetHubName().."\r\n" 
tmp = tmp.."\t??? Hub Address: ....\r\n" 
tmp = tmp.."\t??? Hub Desc: "..frmHub:GetHubDescr().."\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? The Hub Cmd's >>> type !help and !rules. Please Read and Abide by them! \r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? Users Online: "..frmHub:GetUsersCount().."\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? Masters Online: "..GetOnline("Master").."\r\n" 
tmp = tmp.."\t??? Operators Online: "..GetOnline("Operator").."\r\n" 
tmp = tmp.."\t??? VIPs Online: "..GetOnline("VIP").."\r\n" 
tmp = tmp.."\t??? REGs Online: "..GetOnline("Reg").."\r\n" 
tmp = tmp.."\ \r\n" 


user:SendPM(sBotName,tmp) 
end


Recently started to make my own bot...

Still fairly new to LUA but....

as it is would this script be suitable to add into my bot, or would edits need to be made?

Thanx

Woody
Owner of UK...     dc-hubs2     ...UK
Main Address dc-hubs2.ath.cx
Alt Address dc-hubs.no-ip.com
Apart of DC-HUBS NETWORK

pHaTTy

well dont forget the functions must mix if they deicated functions, what i mean is

function DataArrival(whatever,youhave)
end

function NewUserConnected(whatever)
end

function OpConnected(whatever)
end

function Main()
end

these functions must combine

hope u understand if u can post ur script, and ill be happy to help ;)
Resistance is futile!

Woodster

My Script is too long to post on here

:(

Woody
Owner of UK...     dc-hubs2     ...UK
Main Address dc-hubs2.ath.cx
Alt Address dc-hubs.no-ip.com
Apart of DC-HUBS NETWORK

pHaTTy

QuoteOriginally posted by Woodster
My Script is too long to post on here

:(

Woody


post you OpConnected function and new user connect function

EDIT: and your globals such as botname = balh

just so i know what global name u have used
Resistance is futile!

Woodster

#4
function OpConnected(curUser)
	
	if (isSuperOp(curUser.sName) == "TRUE") then
		SendToAll(Bot, "The Super Operator -->>"..curUser.sName.."<<--  has entered the hub, Hello "..curUser.sName.."!")
	else
		SendToAll(Bot, "The Operator -->> "..curUser.sName.." <--  has entered the hub, Hello "..curUser.sName.."!")
	end
end

You mean that?
Owner of UK...     dc-hubs2     ...UK
Main Address dc-hubs2.ath.cx
Alt Address dc-hubs.no-ip.com
Apart of DC-HUBS NETWORK

pHaTTy

QuoteOriginally posted by Woodster
function OpConnected(curUser)
	
	if (isSuperOp(curUser.sName) == "TRUE") then
		SendToAll(Bot, "The Super Operator -->>"..curUser.sName.."<<--  has entered the hub, Hello "..curUser.sName.."!")
	else
		SendToAll(Bot, "The Operator -->> "..curUser.sName.." <--  has entered the hub, Hello "..curUser.sName.."!")
	end
end

You mean that?

well yup, for example, ill combine the oc for you

function OpConnected(user) 
	local i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)%$$") 
	usershare = format("%0.2f", tonumber(share)/(1024*1024*1024)) 
	local tmp 
	tmp = "Welcome to "..frmHub:GetHubName().."\r\n" 
	tmp = tmp.."\ \r\n" 
	tmp = tmp.."\t??? Your Nick: "..user.sName.."\r\n" 
	tmp = tmp.."\t??? Your IP: "..user.sIP.."\r\n" 
	tmp = tmp.."\t??? Your share: "..usershare.."GB\r\n" 
	tmp = tmp.."\ \r\n" 
	tmp = tmp.."\t??? Hub Name: "..frmHub:GetHubName().."\r\n" 
	tmp = tmp.."\t??? Hub Address: ....\r\n" 
	tmp = tmp.."\t??? Hub Desc: "..frmHub:GetHubDescr().."\r\n" 
	tmp = tmp.."\ \r\n" 
	tmp = tmp.."\t??? The Hub Cmd's >>> type !help and !rules. Please Read and Abide by them! \r\n" 
	tmp = tmp.."\ \r\n"
	tmp = tmp.."\t??? Masters Online: "..GetOnline("Master").."\r\n" 
	tmp = tmp.."\t??? Operators Online: "..GetOnline("Operator").."\r\n" 
	tmp = tmp.."\t??? VIPs Online: "..GetOnline("VIP").."\r\n" 
	tmp = tmp.."\t??? REGs Online: "..GetOnline("Reg").."\r\n" 
	tmp = tmp.."\ \r\n" 
	user:SendPM(Bot,tmp)
	if (isSuperOp(curUser.sName) == "TRUE") then
		SendToAll(Bot, "The Super Operator -->>"..curUser.sName.."<<--  has entered the hub, Hello "..curUser.sName.."!")
	else
		SendToAll(Bot, "The Operator -->> "..curUser.sName.." <--  has entered the hub, Hello "..curUser.sName.."!")
	end
end

give other a shot and pst it here if doesnt work and ill correct it ;)
Resistance is futile!

Woodster

**** **** **** ****

Just deleted my BOT  X(  X(  X(

 ;(  ;(  ;(  ;(  ;(  ;(  ;(  ;(  ;(  ;(  ;(

Oh Well guess it wasnt ment to be!

Either i will start again....... or scan the forums for a basic bot that i can adapt and make better

 ;(  ;(  ;(  ;(  ;(  ;(  ;(  ;(  ;(  ;(  ;(

Thanx anyway for your help phatty - much appreciated

Woody
Owner of UK...     dc-hubs2     ...UK
Main Address dc-hubs2.ath.cx
Alt Address dc-hubs.no-ip.com
Apart of DC-HUBS NETWORK

pHaTTy

QuoteOriginally posted by Woodster
**** **** **** ****

Just deleted my BOT  X(  X(  X(

 ;(  ;(  ;(  ;(  ;(  ;(  ;(  ;(  ;(  ;(  ;(

Oh Well guess it wasnt ment to be!

Either i will start again....... or scan the forums for a basic bot that i can adapt and make better

 ;(  ;(  ;(  ;(  ;(  ;(  ;(  ;(  ;(  ;(  ;(

Thanx anyway for your help phatty - much appreciated

Woody

whaaat? lol

hmmm, well i can make you a base start if u like, depends on what you want in it, also u can take younger gekko versions mess with them if u like, til u get the basic idea,

later,,
Resistance is futile!

SMF spam blocked by CleanTalk