Black Pearl
 

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

Black Pearl

Started by Troubadour, 21 July, 2004, 19:59:34

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Troubadour

-- Black Pearl
--------------------------------------------------------------------------------
-- included !myip for users to find out their IP
-- included !myversion to check your client version
-- added !showreg command
-- description, faq, lol, network, rules and oprules txt file reading.
-- script announcer in the mainchat
-- ops and vip announcing in the mainchat
-- welcome to any new user
-- profile based inbuilt hubfunction assignment
-- multiple help files
-- also included inbuilt hub commands
--------------------------------------------------------------------------------

** Download Black-Pearl **

Regards,
Troubadour
Regards,

Troubadour

** Guardian Forum **

hubaddy:   nederfun.no-ip.com

Psycho_Chihuahua

#1
Could it be modified to welcome admin with a seperate welcome note?


--------- Op Connected ---------

function OpConnected(user)
	SendToAll(BOTName, "[OPS] "..user.sName.." has joined the hub") 
	end

--------- Op Disconnected ---------

function OpDisconnected(user)
	SendToAll(BOTName, "[OPS] "..user.sName.." has left the hub") 
	end

--------- Vip Disconnected ---------

function UserDisconnected(user)
	if user.iProfile == 2 then
	SendToAll(BOTName, "[VIP] "..user.sName.." has left the hub") 
	end
end

---------------- Vip Connected -----------------
function NewUserConnected(user)
	if user.iProfile == 2 then
	SendToAll(BOTName, "[VIP] "..user.sName.." has joined the hub") 
	elseif user.iProfile == nil then
	SendToNick(BOTName, "Welcome to "..sHubName.." " )
	end
end

it would be nice to have the admins/masters in as well please


EDIT

would this work?

function NewUserConnected(user)
	if user.iProfile == 0 then
	SendToAll(BOTName, "[MASTER] "..user.sName.." has joined the hub") 
	elseif user.iProfile == nil then
	SendToNick(BOTName, "Welcome to "..sHubName.." " )
	end
end
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

jackthebest

#2
function OpConnected(user) 
	if user.iProfile == 0 then  
		user:SendData(Bot,"Ecco "..user.sName.." benvenuto") 
		SendToAll(Bot," welcome ADMIN  " ..user.sName)
return 1
	end 
        if user.iProfile == 1 then 
		user:SendData(Bot,"hi master "..user.sName.." ^_^")
		SendToAll(Bot,"Un op ? entrato, salutiamo "..user.sName) 
return 1

in alex v 0.9 i use it
p.s alex doesn' t work please help me!

http://board.univ-angers.fr/thread.php?threadid=2444&boardid=6&sid=94ef48862a4d3010b17e0b78600e7a5e

Psycho_Chihuahua

thnx but then i end up with this:

Syntax Error: `end' expected (to close `if' at line 134);
  last token read: `function' at line 141 in file `\ptokax\scripts\Black_Pearl.lua'
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

jackthebest

#4
QuoteOriginally posted by Psycho_Chihuahua
thnx but then i end up with this:

Syntax Error: `end' expected (to close `if' at line 134);
  last token read: `function' at line 141 in file `\ptokax\scripts\Black_Pearl.lua'

sorry

function OpConnected(user) 
	if user.iProfile == 0 then  
		user:SendData(Bot,"Ecco "..user.sName.." benvenuto") 
		SendToAll(Bot," welcome ADMIN  " ..user.sName)
return 1
	end 
        if user.iProfile == 1 then 
		user:SendData(Bot,"hi master "..user.sName.." ^_^")
		SendToAll(Bot,"Un op ? entrato, salutiamo "..user.sName) 
return 1
end

it' s in italian you can modify it ^_^

Psycho_Chihuahua

#5
tried this:

--------- Op Connected ---------

function OpConnected(user) 
	if user.iProfile == 0 then  
		user:SendData(BOTName, "Welcome to "..sHubName.." " ) 
		SendToAll(BOTName, "[ADM] "..user.sName.." has joined the hub")
return 1
	end 
        if user.iProfile == 1 then 
		user:SendData(BOTName, "Welcome to "..sHubName.." " )
		SendToAll(BOTName, "[OPS] "..user.sName.." has joined the hub") 
return 1
end

--------- Op Disconnected ---------

function OpDisconnected(user) 
	if user.iProfile == 0 then  
		SendToAll(BOTName, "[ADM] "..user.sName.." has keft the hub")
return 1
	end 
        if user.iProfile == 1 then 
		SendToAll(BOTName, "[OPS] "..user.sName.." has left the hub") 
return 1
end

end up with this:
Syntax Error: `end' expected (to close `function' at line 141);
  last token read: `' at line 271 in file `.\ptokax\scripts\Black_Pearl.lua'


**EDIT**

Gone through it again and now got rid of Syntax's with
--------- Op Disconnected ---------

function OpDisconnected(user) 
	if user.iProfile == 0 then  
		SendToAll(BOTName, "[ADM] "..user.sName.." has keft the hub")
return 1
	end 
        if user.iProfile == 1 then 
		SendToAll(BOTName, "[OPS] "..user.sName.." has left the hub") 
return 1
end

--------- Vip Disconnected ---------

function UserDisconnected(user)
	if user.iProfile == 2 then
	SendToAll(BOTName, "[VIP] "..user.sName.." has left the hub") 
	end
end
end

---------------- Vip Connected -----------------
function NewUserConnected(user)
	if user.iProfile == 2 then
	SendToAll(BOTName, "[VIP] "..user.sName.." has joined the hub") 
	elseif user.iProfile == nil then
	SendToNick(BOTName, "Welcome to "..sHubName.." " )
	end
end

thnx alot jackthebest

but it still doesnt show the message at entrance
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

jackthebest

function OpConnected(user) 
	if user.iProfile == 0 then  
		user:SendData(BOTName,"Ecco "..user.sName.." benvenuto") 
		SendToAll(Bot," welcome ADMIN  " ..user.sName)
return 1
	end 
        if user.iProfile == 1 then 
		user:SendData(Bot,"hi master "..user.sName.." ^_^")
		SendToAll(BOTName,"Un op ? entrato, salutiamo "..user.sName) 
return 1
end

thx to you

Psycho_Chihuahua

#7
still the same prob, im afraid :(


Seems to work now yippie

-- Black Pearl by Troubadour

-- included !myip for users to find out their IP
-- included !myversion to check your client version
-- added !showreg command
-- description, faq, lol, network, rules and oprules txt file reading.
-- script announcer in the mainchat
-- ops and vip announcing in the mainchat
-- welcome to any new user
-- profile based inbuilt hubfunction assignment
-- multiple help files

--------------------------------------------------------------------------------

BOTName ="Black_Pearl"
Version ="Black Pearl"
Creators ="Troubadour"

sUserCount = frmHub:GetUsersCount()
sHubName = frmHub:GetHubName()
sHubDesc = frmHub:GetHubDescr()
sRedirect = frmHub:GetRedirectAddress()
sMaxUsers = frmHub:GetMaxUsers()
sMinShare = frmHub:GetMinShare()/(1024)
sCurrentShare = frmHub:GetCurrentShareAmount()/(1024^3)

ptokaxcommands = {
	op = 1, drop = 1, ban = 1, unban = 1, nickban = 1, getbanlist = 1,
	getinfo = 1, gag = 1, ungag = 1, banip = 1, ipinfo = 1, iprangeinfo = 1,
	userinfo = 1, clrtempban = 1, stat = 1 }

ptokax2commands = {
	clrpermban = 1, topic = 1, reloadtxt = 1 }

function Main() 
	frmHub:UnregBot(BOTName)
	frmHub:RegBot(BOTName)
	SendToAll("( >>>>  "..Version.." Started"..date(" the %d/%m-%Y at %X ").."  <<<< )")
	BOTNameInfo = "$MyINFO $ALL "..BOTName.." <++V:1 Black_Pearl,C:Troubadour> $ $Black Light"..strchar( 1 ).."$black_pearl@dhq-eurotopia.no-ip.com$" 
	SendToAll(BOTNameInfo)
end 

function DataArrival(user, data) 
	if strsub(data, 1, 1) == "<" then
		data=strsub(data,1,strlen(data)-1)
		s,e,cmd = strfind(data,"%b<>%s+(%S+)")
		end
		if (cmd=="!help") then 
			if user.iProfile == nil then 
				SendUserhelp(user) 
				return 1 
			elseif user.iProfile == 0 then 
				SendMasterhelp(user) 
				return 1 
			elseif user.iProfile == 1 then 
				SendOpshelp(user) 
				return 1 
			elseif user.iProfile == 2 then 
				SendViphelp(user) 
				return 1 
			elseif user.iProfile == 3 then 
				SendReghelp(user) 
				return 1 
			elseif user.iProfile == 4 then 
				SendModeratorhelp(user) 
				return 1 
			end 
		elseif (cmd=="!lol") then 
			SendLol(user) 
			return 1 
		elseif (cmd=="!rules") then 
			SendRules(user) 
			return 1 
		elseif (cmd=="!network") then 
			SendNetwork(user) 
			return 1 
		elseif (cmd=="!faq") then 
			SendFaq(user) 
			return 1 
		elseif (cmd=="!description") then 
			SendDescription(user) 
			return 1 
		elseif (cmd=="!showreg") then
			showreg(user)
			return 1
		elseif (cmd == "!myip" ) then
			user:SendData(BOTName,"Your ip is: "..user.sIP)
			return 1
		elseif (cmd == "!myversion" ) then
			user:SendData(BOTName,"Your client version is: "..user.iVersion)
			return 1
		elseif (cmd == "!addreguser") then 
			if user.iProfile == 1 or user.iProfile == 0 or user.iProfile == 4 then 
				return 0 
			elseif user.iProfile == nil then 
				user:SendPM(BOTName, "you are not allowed to use this command") 
			end 
		elseif (cmd == "!me") then 
			AddAChatter(user) 
			return 0 
		end
			local s, e, cmd, args = strfind(data, "^%b<> %!(%a+)%s*(.*)%|$")
			if s and ptokaxcommands[cmd] then
			if user.iProfile == 1 or user.iProfile == 0 or user.iProfile == 4 then 
			return 0
			elseif user.iProfile == nil then
			SendPM(BOTName, "you are not allowed to use this command") 
		end
			local s, e, cmd, args = strfind(data, "^%b<> %!(%a+)%s*(.*)%|$")
			if s and ptokax2commands[cmd] then
			if user.iProfile == 1 or user.iProfile == 4 then 
			return 0
			elseif user.iProfile == nil then
			SendPM(BOTName, "you are not allowed to use this command") 
		end
		elseif (cmd == "!restartscripts") and user.iProfile == 0 then 
			return 0 
		elseif (cmd == "!restart") and user.iProfile == 0 then 
			return 0 
		end
	end 
end 


--------- Op Connected ---------

function OpConnected(user) 
	if user.iProfile == 0 then  
		user:SendData(BOTName, "Welcome to "..sHubName.." " ) 
		SendToAll(Bot, "[MAS] "..user.sName.." has entered the hub")
return 1
	end 
        if user.iProfile == 1 then 
		user:SendData(Bot, "Welcome to "..sHubName.." " )
		SendToAll(BOTName, "[OPS] "..user.sName.." has entered the hub") 
return 1
	end
end

--------- Op Disconnected ---------

function OpDisconnected(user) 
	if user.iProfile == 0 then  
		SendToAll(BOTName, "[MAS] "..user.sName.." has left the hub")
return 1
	end 
        if user.iProfile == 1 then 
		SendToAll(BOTName, "[OPS] "..user.sName.." has left the hub") 
return 1
	end 
end

--------- Vip Disconnected ---------

function UserDisconnected(user)
	if user.iProfile == 2 then
	SendToAll(BOTName, "[VIP] "..user.sName.." has left the hub") 
	end
end

---------------- Vip Connected -----------------
function NewUserConnected(user)
	if user.iProfile == 2 then
	SendToAll(BOTName, "[VIP] "..user.sName.." has joined the hub") 
	elseif user.iProfile == nil then
	SendToNick(BOTName, "Welcome to "..sHubName.." " )
	end
end

function DoRead(user)
	while 1 do 
		line = read() 
		if line == nil then break end
			user:SendPM(BOTName, line)
		end 
	readfrom() 
end

function showreg(user)
	user:SendPM(BOTName, "==> Regged users <==")
	user:SendPM(BOTName, "_______________________________")
	user:SendPM(BOTName, "??? Level\t==> Nick")
	user:SendPM(BOTName, "???????????????????????????????")
	local allprofiles = GetProfiles()
	local index, profile, index2, username, n
	for index, profile in allprofiles do
		if strlower(profile) ~= strlower("reg") then
			n = 0
			message = "??? "..profile.."\t==> "
			local users = GetUsersByProfile(profile)
			for index2, username in users do
				if not username or username == "" then
					message = nil
				elseif n < 3 then
					message = message..username.."\t"
					n = n + 1
				else
					user:SendPM(BOTName, message)
					message = "??? \t\t==> "..username.."\t"
					n = 1
				end
			end
			if message == "??? "..profile.."\t==> " then
				message = nil
			end
			user:SendPM(BOTName, message)
		end
	end
end

function SendOprules(user) 
	readfrom("Data/oprules.txt") 
	DoRead(user)
end

function SendRules(user) 
	readfrom("Data/rules.txt") 
	DoRead(user) 
end

function SendNetwork(user) 
	readfrom("Data/network.txt") 
	DoRead(user) 
end

function SendLol(user) 
	readfrom("Data/lol.txt") 
	DoRead(user)
end

function SendFaq(user) 
	readfrom("Data/faq.txt") 
	DoRead(user)
end

function SendDescription(user) 
	readfrom("Data/description.txt") 
	DoRead(user) 
end

function SendUserhelp(user) 
	readfrom("Data/userhelp.txt") 
	DoRead(user)  
end

function SendMasterhelp(user) 
	readfrom("Data/masterhelp.txt") 
	DoRead(user)  
end

function SendOpshelp(user) 
	readfrom("Data/opshelp.txt") 
	DoRead(user)  
end

function SendViphelp(user) 
	readfrom("Data/viphelp.txt") 
	DoRead(user) 
end

function SendReghelp(user) 
	readfrom("Data/reghelp.txt") 
	DoRead(user) 
end

function SendModeratorhelp(user) 
	readfrom("Data/moderatorhelp.txt") 
	DoRead(user) 
end

--------------------------------------------------------------------------------
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Troubadour

Do it like this


-- Black Pearl by Troubadour

-- included !myip for users to find out their IP
-- included !myversion to check your client version
-- added !showreg command
-- description, faq, lol, network, rules and oprules txt file reading.
-- script announcer in the mainchat
-- ops and vip announcing in the mainchat
-- welcome to any new user
-- profile based inbuilt hubfunction assignment
-- multiple help files

--------------------------------------------------------------------------------

BOTName ="Black_Pearl"
Version ="Black Pearl"
Creators ="Troubadour"

sUserCount = frmHub:GetUsersCount()
sHubName = frmHub:GetHubName()
sHubDesc = frmHub:GetHubDescr()
sRedirect = frmHub:GetRedirectAddress()
sMaxUsers = frmHub:GetMaxUsers()
sMinShare = frmHub:GetMinShare()/(1024)
sCurrentShare = frmHub:GetCurrentShareAmount()/(1024^3)

ptokaxcommands = {
	op = 1, drop = 1, ban = 1, unban = 1, nickban = 1, getbanlist = 1,
	getinfo = 1, gag = 1, ungag = 1, banip = 1, ipinfo = 1, iprangeinfo = 1,
	userinfo = 1, clrtempban = 1, stat = 1 }

ptokax2commands = {
	clrpermban = 1, topic = 1, reloadtxt = 1 }

function Main() 
	frmHub:UnregBot(BOTName)
	frmHub:RegBot(BOTName)
	SendToAll("( >>>>  "..Version.." Started"..date(" the %d/%m-%Y at %X ").."  <<<< )")
	BOTNameInfo = "$MyINFO $ALL "..BOTName.." <++V:1 Black_Pearl,C:Troubadour> $ $Black Light"..strchar( 1 ).."$black_pearl@dhq-eurotopia.no-ip.com$" 
	SendToAll(BOTNameInfo)
end 

function DataArrival(user, data) 
	if strsub(data, 1, 1) == "<" then
		data=strsub(data,1,strlen(data)-1)
		s,e,cmd = strfind(data,"%b<>%s+(%S+)")
		end
		if (cmd=="!help") then 
			if user.iProfile == nil then 
				SendUserhelp(user) 
				return 1 
			elseif user.iProfile == 0 then 
				SendMasterhelp(user) 
				return 1 
			elseif user.iProfile == 1 then 
				SendOpshelp(user) 
				return 1 
			elseif user.iProfile == 2 then 
				SendViphelp(user) 
				return 1 
			elseif user.iProfile == 3 then 
				SendReghelp(user) 
				return 1 
			elseif user.iProfile == 4 then 
				SendModeratorhelp(user) 
				return 1 
			end 
		elseif (cmd=="!lol") then 
			SendLol(user) 
			return 1 
		elseif (cmd=="!rules") then 
			SendRules(user) 
			return 1 
		elseif (cmd=="!network") then 
			SendNetwork(user) 
			return 1 
		elseif (cmd=="!faq") then 
			SendFaq(user) 
			return 1 
		elseif (cmd=="!description") then 
			SendDescription(user) 
			return 1 
		elseif (cmd=="!showreg") then
			showreg(user)
			return 1
		elseif (cmd == "!myip" ) then
			user:SendData(BOTName,"Your ip is: "..user.sIP)
			return 1
		elseif (cmd == "!myversion" ) then
			user:SendData(BOTName,"Your client version is: "..user.iVersion)
			return 1
		elseif (cmd == "!addreguser") then 
			if user.iProfile == 1 or user.iProfile == 0 or user.iProfile == 4 then 
				return 0 
			elseif user.iProfile == nil then 
				user:SendPM(BOTName, "you are not allowed to use this command") 
			end 
		elseif (cmd == "!me") then 
			AddAChatter(user) 
			return 0 
		end
			local s, e, cmd, args = strfind(data, "^%b<> %!(%a+)%s*(.*)%|$")
			if s and ptokaxcommands[cmd] then
			if user.iProfile == 1 or user.iProfile == 0 or user.iProfile == 4 then 
			return 0
			elseif user.iProfile == nil then
			SendPM(BOTName, "you are not allowed to use this command") 
		end
			local s, e, cmd, args = strfind(data, "^%b<> %!(%a+)%s*(.*)%|$")
			if s and ptokax2commands[cmd] then
			if user.iProfile == 1 or user.iProfile == 4 then 
			return 0
			elseif user.iProfile == nil then
			SendPM(BOTName, "you are not allowed to use this command") 
		end
		elseif (cmd == "!restartscripts") and user.iProfile == 0 then 
			return 0 
		elseif (cmd == "!restart") and user.iProfile == 0 then 
			return 0 
		end
	end 
end 


--------- Op Connected ---------

function OpConnected(user) 
	if user.iProfile == 0 then  
		user:SendData(BOTName, "Welcome to "..sHubName.." " ) 
		SendToAll(Bot, "[MAS] "..user.sName.." has entered the hub")
       elseif user.iProfile == 1 then 
		user:SendData(Bot, "Welcome to "..sHubName.." " )
		SendToAll(BOTName, "[OPS] "..user.sName.." has entered the hub") 
return 1
	end
end

--------- Op Disconnected ---------

function OpDisconnected(user) 
	if user.iProfile == 0 then  
		SendToAll(BOTName, "[MAS] "..user.sName.." has left the hub")
        elseif user.iProfile == 1 then 
		SendToAll(BOTName, "[OPS] "..user.sName.." has left the hub") 
return 1
	end 
end

--------- Vip Disconnected ---------

function UserDisconnected(user)
	if user.iProfile == 2 then
	SendToAll(BOTName, "[VIP] "..user.sName.." has left the hub") 
	end
end

---------------- Vip Connected -----------------
function NewUserConnected(user)
	if user.iProfile == 2 then
	SendToAll(BOTName, "[VIP] "..user.sName.." has joined the hub") 
	elseif user.iProfile == nil then
	SendToNick(BOTName, "Welcome to "..sHubName.." " )
	end
end

function DoRead(user)
	while 1 do 
		line = read() 
		if line == nil then break end
			user:SendPM(BOTName, line)
		end 
	readfrom() 
end

function showreg(user)
	user:SendPM(BOTName, "==> Regged users <==")
	user:SendPM(BOTName, "_______________________________")
	user:SendPM(BOTName, "??? Level\t==> Nick")
	user:SendPM(BOTName, "???????????????????????????????")
	local allprofiles = GetProfiles()
	local index, profile, index2, username, n
	for index, profile in allprofiles do
		if strlower(profile) ~= strlower("reg") then
			n = 0
			message = "??? "..profile.."\t==> "
			local users = GetUsersByProfile(profile)
			for index2, username in users do
				if not username or username == "" then
					message = nil
				elseif n < 3 then
					message = message..username.."\t"
					n = n + 1
				else
					user:SendPM(BOTName, message)
					message = "??? \t\t==> "..username.."\t"
					n = 1
				end
			end
			if message == "??? "..profile.."\t==> " then
				message = nil
			end
			user:SendPM(BOTName, message)
		end
	end
end

function SendOprules(user) 
	readfrom("Data/oprules.txt") 
	DoRead(user)
end

function SendRules(user) 
	readfrom("Data/rules.txt") 
	DoRead(user) 
end

function SendNetwork(user) 
	readfrom("Data/network.txt") 
	DoRead(user) 
end

function SendLol(user) 
	readfrom("Data/lol.txt") 
	DoRead(user)
end

function SendFaq(user) 
	readfrom("Data/faq.txt") 
	DoRead(user)
end

function SendDescription(user) 
	readfrom("Data/description.txt") 
	DoRead(user) 
end

function SendUserhelp(user) 
	readfrom("Data/userhelp.txt") 
	DoRead(user)  
end

function SendMasterhelp(user) 
	readfrom("Data/masterhelp.txt") 
	DoRead(user)  
end

function SendOpshelp(user) 
	readfrom("Data/opshelp.txt") 
	DoRead(user)  
end

function SendViphelp(user) 
	readfrom("Data/viphelp.txt") 
	DoRead(user) 
end

function SendReghelp(user) 
	readfrom("Data/reghelp.txt") 
	DoRead(user) 
end

function SendModeratorhelp(user) 
	readfrom("Data/moderatorhelp.txt") 
	DoRead(user) 
end

--------------------------------------------------------------------------------
Regards,

Troubadour

** Guardian Forum **

hubaddy:   nederfun.no-ip.com

Troubadour

#9
code:--------------------------------------------------------------------------------
function OpConnected(user)
   if user.iProfile == 0 then  
      user:SendData(BOTName,"Ecco "..user.sName.." benvenuto"
      SendToAll(Bot," welcome ADMIN  " ..user.sName)
return 1
   end
        if user.iProfile == 1 then
      user:SendData(Bot,"hi master "..user.sName.." ^_^"
      SendToAll(BOTName,"Un op ? entrato, salutiamo "..user.sName)
return 1
end
--------------------------------------------------------------------------------

should be like


code:--------------------------------------------------------------------------------
function OpConnected(user)
   if user.iProfile == 0 then  
      user:SendData(BOTName,"Ecco "..user.sName.." benvenuto"
      SendToAll(BOTName," welcome ADMIN  " ..user.sName)
        elseif user.iProfile == 1 then
      user:SendData(BOTName,"hi master "..user.sName.." ^_^"
      SendToAll(BOTName,"Un op ? entrato, salutiamo "..user.sName)
return 1
end
--------------------------------------------------------------------------------
Regards,

Troubadour

** Guardian Forum **

hubaddy:   nederfun.no-ip.com

jackthebest

in the copy / paste to alex i forgot the Bot ---> BOTname
sorry

Troubadour

also should use more
elseif
instead of
return 1
end
if ..........


just a tip.
Regards,

Troubadour

** Guardian Forum **

hubaddy:   nederfun.no-ip.com

Psycho_Chihuahua

thnx alot m8, works fine now.
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Herodes

Trobadour,
I have a suggestion to make...
I think it would be much better if u used one function to display any of the text files ...

You can find one in the How To section by Optimus that is quite complete ...
Doing that to your script has saved it from many lines ...
I propose this because first it would be a bit easier to coordinate if you have this script developed further.
and second because it would save some memory .. :)

Troubadour

Thanks for the tip, Herodes.
Indeed it will save memory and the script will reduce in size.
My intention is not to develop this script any further, it was to help someone out, with the basic setup of a script. (as an example)
While i am working on Guardian Nemesis at this moment. (wich we will release this week).
Then i continue with Guardian Corridor.
Once that version is finished, i will decide if i will continue Black Pearl or let someone else take over.
If someone wants to take it over, be my guest.
If i will continue this script, i will use the function for calling all txt files or i will store them in a table (like i did in Guardian).
When there are enough people who want this script to be continued then i will do it from time to time.

Regards,
Troubadour
Regards,

Troubadour

** Guardian Forum **

hubaddy:   nederfun.no-ip.com

Psycho_Chihuahua

Now i've been trying to get all Levels into the Bot without any luck....

Heres what i've done so there r at least no syntax errors

--------- Op Connected ---------

function OpConnected(user) 
	if user.iProfile == 0 then  
		user:SendData(BOTName, "Welcome to "..sHubName.." " ) 
		SendToAll(Bot, "[MAS] "..user.sName.." has entered the hub")
       elseif user.iProfile == 1 then 
		user:SendData(Bot, "Welcome to "..sHubName.." " )
		SendToAll(BOTName, "[OPS] "..user.sName.." has entered the hub") 
return 1
	end
end

--------- Op Disconnected ---------

function OpDisconnected(user) 
	if user.iProfile == 0 then  
		SendToAll(BOTName, "[MAS] "..user.sName.." has left the hub")
        elseif user.iProfile == 1 then 
		SendToAll(BOTName, "[OPS] "..user.sName.." has left the hub") 
return 1
	end 
end

--------- Vip Disconnected ---------

function UserDisconnected(user)
	if user.iProfile == nil then
	SendToAll(BOTName, ""..user.sName.." has left the hub") 
        elseif user.iProfile == 2 then 
	SendToAll(BOTName, "[VIP] "..user.sName.." has left the hub") 
        elseif user.iProfile == 3 then 
	SendToAll(BOTName, "[REG] "..user.sName.." has left the hub") 
return 1
	end
end

---------------- Vip Connected -----------------
function NewUserConnected(user)
	if user.iProfile == nil then
	SendToAll(BOTName, "Welcome to "..sHubName.." " ) 
	elseif user.iProfile == 2 then
	SendToNick(BOTName, "[VIP] "..user.sName.." has joined the hub")
	elseif user.iProfile == 3 then
	SendToNick(BOTName, "[REG] "..user.sName.." has joined the hub")
return 1
	end
end

any hints to what i've done wrong?
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Herodes

#16
QuoteOriginally posted by Psycho_Chihuahua
Now i've been trying to get all Levels into the Bot without any luck....

Heres what i've done so there r at least no syntax errors

--------- Op Connected ---------

function OpConnected(user) 
	if user.iProfile == 0 then  
		user:SendData(BOTName, "Welcome to "..sHubName.." " ) 
		SendToAll(Bot, "[MAS] "..user.sName.." has entered the hub")
       elseif user.iProfile == 1 then 
		user:SendData(Bot, "Welcome to "..sHubName.." " )
		SendToAll(BOTName, "[OPS] "..user.sName.." has entered the hub") 
return 1
	end
end
any hints to what i've done wrong?


In this function I see an mistake that is probably the source of ur problem ...

try return 1 after the end of the if then elseif then sequence...
Or if that dont work then try removing the return 1 completely ..  :)

... I suspect this is the same for the rest of the functions.

Optimus


Psycho_Chihuahua

It must have been something to do with the formatting or so.....a little shuffling round to:
--------- Op Connected ---------

function OpConnected(user) 
	if user.iProfile == 0 then  
		user:SendData(BOTName, "Welcome to "..sHubName.." " ) 
		SendToAll(Bot, "[MAS] "..user.sName.." has entered the hub")
return 1
       elseif user.iProfile == 1 then 
		user:SendData(Bot, "Welcome to "..sHubName.." " )
		SendToAll(BOTName, "[OPS] "..user.sName.." has entered the hub") 
return 1
	end
end

--------- Op Disconnected ---------

function OpDisconnected(user) 
	if user.iProfile == 0 then  
		SendToAll(BOTName, "[MAS] "..user.sName.." has left the hub")
return 1
       elseif user.iProfile == 1 then 
		SendToAll(BOTName, "[OPS] "..user.sName.." has left the hub") 
return 1
	end 
end

--------- Vip Disconnected ---------

function UserDisconnected(user)
	if user.iProfile == nil then
		SendToAll(BOTName, ""..user.sName.." has left the hub") 
       elseif user.iProfile == 2 then 
		SendToAll(BOTName, "[VIP] "..user.sName.." has left the hub") 
       elseif user.iProfile == 3 then 
		SendToAll(BOTName, "[REG] "..user.sName.." has left the hub") 
return 1
	end
end

---------------- Vip Connected -----------------
function NewUserConnected(user)
	if user.iProfile == nil then
		user:SendData(BOTName, "Welcome to "..sHubName.." " ) 
		SendToAll(BOTName, "Welcome to "..sHubName.." " ) 
       elseif user.iProfile == 2 then 
		user:SendData(BOTName, "Welcome to "..sHubName.." " ) 
		SendToNick(BOTName, "[VIP] "..user.sName.." has joined the hub")
       elseif user.iProfile == 3 then 
		user:SendData(BOTName, "Welcome to "..sHubName.." " ) 
		SendToNick(BOTName, "[REG] "..user.sName.." has joined the hub")
return 1
	end
end
must of done the trick.
Didnt change anything except for some spacing in the VIP part and inserted the
user:SendData(BOTName, "Welcome to "..sHubName.." " )
lines :) no syntax errors and everything working.

thnx u guys for the help :)
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Optimus

Well i see no use for the return 1 with the login part.

Psycho_Chihuahua

QuoteOriginally posted by Optimus
Well i see no use for the return 1 with the login part.
yeah, i noticed to. well for a noob like me it all takes a bit longer :)
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Troubadour

i will create you an example of entering through profile with random intros.

Regards,
Troubadour
Regards,

Troubadour

** Guardian Forum **

hubaddy:   nederfun.no-ip.com

Optimus

Quoteyeah, i noticed to. well for a noob like me it all takes a bit longer :)
No prob Psycho_Chihuahua i understand that. Just dropped by the thread. lol ;)

Psycho_Chihuahua

#23
--------- Op Connected ---------

function OpConnected(user) 
	if user.iProfile == 0 then  
		user:SendData(BOTName, "Welcome to "..sHubName.." " ) 
		SendToAll(BOTName, "[MAS] "..user.sName.." has entered the hub")
       elseif user.iProfile == 1 then 
		user:SendData(BOTName, "Welcome to "..sHubName.." " )
		SendToAll(BOTName, "[OPS] "..user.sName.." has entered the hub") 
	end
end

--------- Op Disconnected ---------

function OpDisconnected(user) 
	if user.iProfile == 0 then  
		SendToAll(BOTName, "[MAS] "..user.sName.." has left the hub")
       elseif user.iProfile == 1 then 
		SendToAll(BOTName, "[OPS] "..user.sName.." has left the hub") 
	end 
end

--------- Vip Disconnected ---------

function UserDisconnected(user)
	if user.iProfile == nil then
		SendToAll(BOTName, ""..user.sName.." has left the hub") 
       elseif user.iProfile == 2 then 
		SendToAll(BOTName, "[VIP] "..user.sName.." has left the hub") 
       elseif user.iProfile == 3 then 
		SendToAll(BOTName, "[REG] "..user.sName.." has left the hub") 
	end
end

---------------- Vip Connected -----------------
function NewUserConnected(user)
	if user.iProfile == nil then
		user:SendData(BOTName, "Welcome to "..sHubName.." " ) 
		SendToAll(BOTName, "Welcome to "..sHubName.." " ) 
       elseif user.iProfile == 2 then 
		user:SendData(BOTName, "Welcome to "..sHubName.." " ) 
		SendToNick(BOTName, "[VIP] "..user.sName.." has joined the hub")
       elseif user.iProfile == 3 then 
		user:SendData(BOTName, "Welcome to "..sHubName.." " ) 
		SendToNick(BOTName, "[REG] "..user.sName.." has joined the hub")
	end
end
Finally all works as i wanted  :D
Masters/Operaters/VIP's/Registered and normal Users are now welcomed by the Bot.
Thnx u guys for helping out
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Troubadour

check your spelling
it still has Bot instead of BOTName in some places m8.

Regards,
Troubadour
Regards,

Troubadour

** Guardian Forum **

hubaddy:   nederfun.no-ip.com

SMF spam blocked by CleanTalk