OpChat++ - Page 4
 

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

OpChat++

Started by jiten, 01 April, 2005, 13:53:24

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

jiten

QuoteOriginally posted by Krysalis
EDIT: Found a bug ;-) Invitet users arent invitet after Scriptrestart.

They stay invitet after they disconnect but not if scripts where restartet. Can u fix this?
Tested it here and nothing like that happened.

Krysalis

Everytime i restart scripts in hubsoft, i have to invitet all again.

Greets

jiten

QuoteOriginally posted by Krysalis
Everytime i restart scripts in hubsoft, i have to invitet all again.

Greets
It must be a result of some change you made. Do you have the folder "Logs"?
If it still doesn't work, post your script here so that I can have a look.

Cheers

Krysalis

--/ Lua 5 version 1.1a by jiten
-- Translatet to German by Krysalis
-- Changed: Profile Permissions;
-- Added: Optional message to every user invited on Hub Start/Script Restart
-- Added: Automatic Folder creating
-- Added: add, read and del commands (requested by Krysalis)

--## OpChat++ By nErBoS 
--## Commands: 
--## +invite  -- Invites an user to OpChat
--## +delinvite  -- Removes the user from OpChat
--## +invitelist -- List all OpChat invited users
--## +talklog -- Show all the talking while you were offline

--## Settings ##-- 
sOpChat = "???Heaven?"					-- OpChat Bot Name (Set it to everything but "OpChat")
sBot = "???Heaven?"				-- Bot Name
sFolder = "Logs"					-- Folder where the .tbl files are stord
fInvite = "Invite.tbl"					-- File where the invited users are stored
fLog = "Log.tbl"					-- File where the chat logs are stored
fRelease = "logs/Releases.tbl"				-- File where the Address File is stored
sendCustom = 1						-- 1 = Custom Message to invited user on Hub/Script Restart; 0 = Not
customMsg = "Du bist Member im Heaven. Enjoy your Stay"	-- Message sent to them
arrOpLevel = {						-- Put here the profile with operator privileges and its respective level
	["Master"] = 0,
} 
--## END ##--

arrInvite = {} arrLog = {} Releases = {}

Main = function() 
	frmHub:RegBot(sOpChat)
	if loadfile(fInvite) then dofile(fInvite) end
	if loadfile(fLog) then dofile(fLog) end Refresh() if loadfile(fRelease) then dofile(fRelease) end
	if sendCustom == 1 then
		for usr, aux in arrInvite do 
			if (GetItemByName(usr) ~= nil) then 
				SendToNick(GetItemByName(usr).sName, "$To: "..GetItemByName(usr).sName.." eingeladen von: "..sOpChat.." $<"..sOpChat.."> "..customMsg..".") 
			end 
		end
	end
end 

OnExit = function() 
	SaveToFile(sFolder.."/"..fInvite , arrInvite , "arrInvite") 
	SaveToFile(sFolder.."/"..fLog , arrLog , "arrLog") 
end 

OpConnected = function(user) 
	if (arrLog[user.sName] == nil) then 
		Refresh() 
	elseif (arrLog[user.sName]["Talk"] ~= "") then 
		user:SendPM(sOpChat, "W?hrend du weg warst, hast du was verpasst. Schreib +talklog ums zu lesen.") 
	end 
	arrLog[user.sName]["Mode"] = "online" 
end 

OpDisconnected = function(user) 
	arrLog[user.sName]["Mode"] = "offline" 
end 

ChatArrival = function(user, data) 
	local data = string.sub(data, 1, -2) 
	local s,e,cmd = string.find(data,"%b<>%s+[%!%?%+%#](%S+)")
	if (string.sub(data,1,1) == "<") or (string.sub(data,1,5+string.len(sOpChat)) == "$To: "..sOpChat) then
		if cmd then
			local tCmds = {
			["invitelist"] =	function(user)
							local sTmp,op,usr = "Heaven Members:\r\n\r\n" 
							for usr, op in arrInvite do 
								sTmp = sTmp.."User: "..usr.."\tInvited by: "..op.."\r\n" 
							end 
							user:SendPM(sOpChat, sTmp) 
						end,
			["talklog"] =		function(user)
							if (arrLog[user.sName]["Talk"] == "") then 
								user:SendPM(sOpChat, "Du warst immer online, es gibt keine History f?r dich :).") 
							else 
								user:SendPM(sOpChat, "OFFLINE:\r\n\r\n"..arrLog[user.sName]["Talk"]) 
								user:SendPM(sOpChat, "ChatHistory wurde gel?scht.") 
								arrLog[user.sName]["Talk"] = "" 
								SaveToFile(sFolder.."/"..fLog , arrLog , "arrLog") 
							end 
						end,
			["add"]	=	function(user,data)
						local s,e,rel,desc = string.find(data,"%b<>%s+%S+%s+(%S+)%s+(%S+)")
						if rel == nil or desc == nil then
							user:SendPM(sOpChat,"*** Error: Type +add  
") else table.insert( Releases, { user.sName, rel, desc, os.date(), } ) SaveToFile(fRelease,Releases,"Releases") SendPmToOps(sOpChat, user.sName.." hat : "..rel.." eingetragen.") end end, ["read"] = function(user,data) local msg, Exists = "", nil for i = 1, table.getn(Releases) do if Releases[i] then msg = msg.."\r\n\t-=(HeavenFTP Nr. "..i..")=-.\r\n\t["..Releases[i][2].."]\r\n\t"..Releases[i][3].."\r\n\tEingetragen von: "..Releases[i][1].." on "..Releases[i][4].."\r\n" Exists = 1 end end if Exists == nil then user:SendPM(sOpChat,"*** Error: Nix da.") else user:SendPM(sOpChat,msg) end end, } local mCmds = { ["invite"] = function(user,data) local s,e,nick = string.find(data, "%b<>%s+%S+%s+(%S+)") if (nick == nil) then user:SendPM(sOpChat, "Syntax Error, +invite . nick angeben.") elseif (arrInvite[string.lower(nick)] ~= nil) then user:SendPM(sOpChat, "User "..nick.." ist bereits hier.") else arrInvite[string.lower(nick)] = user.sName user:SendPM(sOpChat, "User "..nick.." was invited to OpChat.") if (GetItemByName(nick) ~= nil) then GetItemByName(nick):SendPM(sOpChat, "You were invited to OpChat by Operator "..user.sName) end SendPmToOps(sOpChat, "User "..nick.." wurde eingeladen von Master "..user.sName) SaveToFile(sFolder.."/"..fInvite , arrInvite , "arrInvite") end end, ["delinvite"] = function(user,data) local s,e,nick = string.find(data, "%b<>%s+%S+%s+(%S+)") if (nick == nil) then user:SendPM(sOpChat, "Syntax Error, +delinvite . Nick angeben.") elseif (arrInvite[string.lower(nick)] == nil) then user:SendPM(sOpChat, "User "..nick.." wasn't invited to OpChat.") else arrInvite[string.lower(nick)] = nil user:SendPM(sOpChat, "User "..nick.." ist nicht l?nger unter uns.") if (GetItemByName(nick) ~= nil) then GetItemByName(nick):SendPM(sOpChat, "Account aufgehoben von Master "..user.sName) end SendPmToOps(sOpChat, ""..nick.." wurde ausgeladen von Master "..user.sName) SaveToFile(sFolder.."/"..fInvite , arrInvite , "arrInvite") end end, ["del"] = function(user,data) local s,e,i = string.find(data,"%b<>%s+%S+%s+(%S+)") if i then if Releases[tonumber(i)] then table.remove(Releases,i) SaveToFile(fRelease,Releases,"Releases") user:SendPM(sOpChat,"Address "..i..". wurde erfolgreich gel?scht!") else user:SendPM(sOpChat,"*** Error: Dieser Eintrag ist nicht vorhanden: "..i..".") end else user:SendPM(sBot,"*** Error: Type +del ") end end, } if tCmds[cmd] and user.bOperator or arrInvite[string.lower(user.sName)] then return tCmds[cmd](user,data),1 elseif mCmds[cmd] and user.iProfile == 0 then return mCmds[cmd](user,data),1 else return user:SendPM(sBot,"*** Error: Dieser Befehl ist dir nicht gestattet."),1 end end end local _,_,whoTo = string.find(data,"$To:%s+(%S+)") if (whoTo == sOpChat) then if (user.bOperator or arrInvite[string.lower(user.sName)] ~= nil) then SendTalkToOps(data) SendTalkToInvited(data) return 1 else user:SendPM(sOpChat, "Du hast in diesem Bereich keinen Zutritt.") return 1 end end end ToArrival = ChatArrival SendTalkToOps = function(data) local s,e,from,talk = string.find(data, "$To:%s+%S+%s+From:%s+(%S+)%s+$%b<>%s+(.+)") local aux,profile,usr if (from ~= nil and talk ~= nil) then SaveToLog(from, talk) for aux, profile in GetProfiles() do for aux, usr in GetUsersByProfile(profile) do if (GetItemByName(usr) ~= nil and GetItemByName(usr).bOperator and GetItemByName(usr).sName ~= from) then SendToNick(GetItemByName(usr).sName, "$To: "..GetItemByName(usr).sName.." From: "..sOpChat.." $<"..from.."> "..talk) end end end end end SendTalkToInvited = function(data) local s,e,from,talk = string.find(data, "$To:%s+%S+%s+From:%s+(%S+)%s+$%b<>%s+(.+)") local aux,usr if (from ~= nil and talk ~= nil) then for usr, aux in arrInvite do if (GetItemByName(usr) ~= nil and GetItemByName(usr).sName ~= from) then SendToNick(GetItemByName(usr).sName, "$To: "..GetItemByName(usr).sName.." From: "..sOpChat.." $<"..from.."> "..talk) end end end end Refresh = function() local aux,aux2,usr,profile for profile, aux in arrOpLevel do for aux2, usr in GetUsersByProfile(profile) do if (arrLog[usr] == nil) then arrLog[usr] = {} if (GetItemByName(usr) == nil) then arrLog[usr]["Mode"] = "offline" else arrLog[usr]["Mode"] = "online" end arrLog[usr]["Talk"] = "" elseif (GetItemByName(usr) == nil) then arrLog[usr]["Mode"] = "offline" else arrLog[usr]["Mode"] = "online" end end end SaveToFile(sFolder.."/"..fLog , arrLog , "arrLog") end SaveToLog = function(from, talk) local usr,aux for usr, aux in arrLog do if (arrLog[usr]["Mode"] == "offline") then arrLog[usr]["Talk"] = arrLog[usr]["Talk"].."<"..from.."> "..talk.."\r\n" end end SaveToFile(sFolder.."/"..fLog , arrLog , "arrLog") end Serialize = function(tTable,sTableName,hFile,sTab) sTab = sTab or ""; hFile:write(sTab..sTableName.." = {\n"); for key,value in tTable do if (type(value) ~= "function") then local sKey = (type(key) == "string") and string.format("[%q]",key) or string.format("[%d]",key); if(type(value) == "table") then Serialize(value,sKey,hFile,sTab.."\t"); else local sValue = (type(value) == "string") and string.format("%q",value) or tostring(value); hFile:write(sTab.."\t"..sKey.." = "..sValue); end hFile:write(",\n"); end end hFile:write(sTab.."}"); end SaveToFile = function(file,table,tablename) local hFile = io.open(file,"w+") Serialize(table,tablename,hFile); hFile:close()
 

Take a look. It seems, if the invite.tbl deletet if hub restarts or scripts restarts.

I removed this mkdir function, because i thought it clear .tbl at Start.

jiten

Guess I copied the wrong script on the other day as it had some bugs I had already fixed. But, now I've updated it with the correct one. Where was my head at? :D
Sorry for the trouble.

Cheers

Krysalis

Can i easy fix my version or have i do translatet all again?:(

jiten

QuoteCan i easy fix my version or have i do translatet all again?:(
Yes, you can eheh
Just replace your Main function with this one:
Main = function() 
	frmHub:RegBot(sOpChat)
	if loadfile(sFolder.."/"..fInvite) then dofile(sFolder.."/"..fInvite) else os.execute("mkdir "..sFolder) end
	if loadfile(sFolder.."/"..fLog) then dofile(sFolder.."/"..fLog) end Refresh() if loadfile(sFolder.."/"..fRelease) then dofile(sFolder.."/"..fRelease) end
	if sendCustom == 1 then
		for usr, aux in arrInvite do 
			if (GetItemByName(usr) ~= nil) then 
				SendToNick(GetItemByName(usr).sName, "$To: "..GetItemByName(usr).sName.." From: "..sOpChat.." $<"..sOpChat.."> "..customMsg..".") 
			end 
		end
	end
end
That should do it.

Cheers

Krysalis

Absolutily Happy....nothing more to say:)

Runs very stable

Greets

Krysalis

- 
- 
  Master 
  11111111111111111111111111111111 
  
- 
  Operator 
  11111100011001111111111111111000 
  
- 
  S-Operator 
  11111111111111111111111111111111 
  
- 
  Moderator 
  10000000000000000000000000000000 
  
- 
  S-VIP 
  10000000000000000000000000000000 
  
- 
  VIP 
  10000000000000000000000000000000 
  
- 
  SUser 
  10000000000000000000000000000000 
  
- 
  DUser 
  10000000000000000000000000000000 
  
- 
  Stammie 
  10000000000000000000000000000000 
  
- 
  User 
  10000000000000000000000000000000 
  
- 
  Anw?rter 
  10000000000000000000000000000000 
  
  


Another little thing. Can u tell me my Profile "Numbers"? In TD 4 i found here...Need exactly Numbers, my thoughts are wrong till now.
Thanks in Advance jiten

Greets

GrinSlaW

Hi jiten i found a litle problem if i want to use the inbuild txt viewer in ptokax i have to dissable the opchat bot why ? if i try to use a txt command i only get this error in main chat: *** Error: You are not allowed to use this command


cheers
.:: AcExtreme ::. | .:: AcPro ::.

Krysalis

#85
Found this Problem at the moment, too. Can u do that the scripts ONLY accept cmds in PM. At the moment I cannot use many other mainchat cmds with + and ! as prefix.

PS: And how can be this came in Main?
[01:50] Private message from :
is a client setting or to do in script?
I want this to come in pm window.
Its on chathistory script....but its my second problem @ the Moment ,-)

Greets

jiten

QuoteOriginally posted by GrinSlaW
Hi jiten i found a litle problem if i want to use the inbuild txt viewer in ptokax i have to dissable the opchat bot why ? if i try to use a txt command i only get this error in main chat: *** Error: You are not allowed to use this command


cheers
QuoteFound this Problem at the moment, too.
Fixed and first post updated :]
QuoteAnd how can be this came in Main?
[01:50] Private message from :
is a client setting or to do in script?
Have you ticked "Popup messages from users that are not online" and unticked "Ignore messages from users that are not online" in File - Settings - Advanced ? Or, is that bot registered?

Best regards

Krysalis

#87
second is unticket, first i doesnt found in 0.674
Bot arent regged. after regged, it works mostly, but sometimes is cames in main too....
Thx ,-)

And also, can u give me the last fix passage hgere to fix manually? u know...the translation *g*

Best Regards

jiten

QuoteOriginally posted by Krysalis
second is unticket, first i doesnt found in 0.674
Bot arent regged. after regged, it works mostly, but sometimes is cames in main too....
Thx ,-)

And also, can u give me the last fix passage hgere to fix manually? u know...the translation *g*

Best Regards
Change to this:
fRelease = "Releases.tbl"				-- File where the Address File is stored

if tCmds[cmd] then
	if user.bOperator or arrInvite[string.lower(user.sName)] then
		return tCmds[cmd](user,data),1 
	else
		return user:SendData(sBot,"*** Error: You are not allowed to use this command."),1
	end
elseif mCmds[cmd] then
	if user.iProfile == 0 then
		return mCmds[cmd](user,data),1 
	else
		return user:SendData(sBot,"*** Error: You are not allowed to use this command."),1
	end
end

Best regards

Krysalis

fRelease = "Releases.tbl"
sendCustom = 1						-- 1 = Custom Message to invited user on Hub/Script Restart; 0 = Not
customMsg = "Du bist Member im Heaven. Enjoy your Stay"	-- Message sent to them
arrOpLevel = {						-- Put here the profile with operator privileges and its respective level
	["Master"] = 0,
} 
--## END ##--

arrInvite = {} arrLog = {} Releases = {}

Main = function() 
	frmHub:RegBot(sOpChat)
	if loadfile(sFolder.."/"..fInvite) then dofile(sFolder.."/"..fInvite) else os.execute("mkdir "..sFolder) end
	if loadfile(sFolder.."/"..fLog) then dofile(sFolder.."/"..fLog) end Refresh() if loadfile(sFolder.."/"..fRelease) then dofile(sFolder.."/"..fRelease) end
	if sendCustom == 1 then
		for usr, aux in arrInvite do 
			if (GetItemByName(usr) ~= nil) then 
				SendToNick(GetItemByName(usr).sName, "$To: "..GetItemByName(usr).sName.." From: "..sOpChat.." $<"..sOpChat.."> "..customMsg..".") 
			end 
		end
	end
end  

OnExit = function() 
	SaveToFile(sFolder.."/"..fInvite , arrInvite , "arrInvite") 
	SaveToFile(sFolder.."/"..fLog , arrLog , "arrLog") 
end 

OpConnected = function(user) 
	if (arrLog[user.sName] == nil) then 
		Refresh() 
	elseif (arrLog[user.sName]["Talk"] ~= "") then 
		user:SendPM(sOpChat, "W?hrend du weg warst, hast du was verpasst. Schreib +talklog ums zu lesen.") 
	end 
	arrLog[user.sName]["Mode"] = "online" 
end 

OpDisconnected = function(user) 
	arrLog[user.sName]["Mode"] = "offline" 
end 

ChatArrival = function(user, data) 
	local data = string.sub(data, 1, -2) 
	local s,e,cmd = string.find(data,"%b<>%s+[%!%?%+%#](%S+)")
	if (string.sub(data,1,1) == "<") or (string.sub(data,1,5+string.len(sOpChat)) == "$To: "..sOpChat) then
		if cmd then
			local tCmds = {
			["invitelist"] =	function(user)
							local sTmp,op,usr = "Heaven Members:\r\n\r\n" 
							for usr, op in arrInvite do 
								sTmp = sTmp.."User: "..usr.."\tInvited by: "..op.."\r\n" 
							end 
							user:SendPM(sOpChat, sTmp) 
						end,
			["talklog"] =		function(user)
							if (arrLog[user.sName]["Talk"] == "") then 
								user:SendPM(sOpChat, "Du warst immer online, es gibt keine History f?r dich :).") 
							else 
								user:SendPM(sOpChat, "OFFLINE:\r\n\r\n"..arrLog[user.sName]["Talk"]) 
								user:SendPM(sOpChat, "ChatHistory wurde gel?scht.") 
								arrLog[user.sName]["Talk"] = "" 
								SaveToFile(sFolder.."/"..fLog , arrLog , "arrLog") 
							end 
						end,
			["add"]	=	function(user,data)
						local s,e,rel,desc = string.find(data,"%b<>%s+%S+%s+(%S+)%s+(%S+)")
						if rel == nil or desc == nil then
							user:SendPM(sOpChat,"*** Error: Type +add  
") else table.insert( Releases, { user.sName, rel, desc, os.date(), } ) SaveToFile(fRelease,Releases,"Releases") SendPmToOps(sOpChat, user.sName.." hat : "..rel.." eingetragen.") end end, ["read"] = function(user,data) local msg, Exists = "", nil for i = 1, table.getn(Releases) do if Releases[i] then msg = msg.."\r\n\t-=(HeavenFTP Nr. "..i..")=-.\r\n\t["..Releases[i][2].."]\r\n\t"..Releases[i][3].."\r\n\tEingetragen von: "..Releases[i][1].." on "..Releases[i][4].."\r\n" Exists = 1 end end if Exists == nil then user:SendPM(sOpChat,"*** Error: Nix da.") else user:SendPM(sOpChat,msg) end end, } local mCmds = { ["invite"] = function(user,data) local s,e,nick = string.find(data, "%b<>%s+%S+%s+(%S+)") if (nick == nil) then user:SendPM(sOpChat, "Syntax Error, +invite . nick angeben.") elseif (arrInvite[string.lower(nick)] ~= nil) then user:SendPM(sOpChat, "User "..nick.." ist bereits hier.") else arrInvite[string.lower(nick)] = user.sName user:SendPM(sOpChat, "User "..nick.." was invited to OpChat.") if (GetItemByName(nick) ~= nil) then GetItemByName(nick):SendPM(sOpChat, "You were invited to OpChat by Operator "..user.sName) end SendPmToOps(sOpChat, "User "..nick.." wurde eingeladen von Master "..user.sName) SaveToFile(sFolder.."/"..fInvite , arrInvite , "arrInvite") end end, ["delinvite"] = function(user,data) local s,e,nick = string.find(data, "%b<>%s+%S+%s+(%S+)") if (nick == nil) then user:SendPM(sOpChat, "Syntax Error, +delinvite . Nick angeben.") elseif (arrInvite[string.lower(nick)] == nil) then user:SendPM(sOpChat, "User "..nick.." wasn't invited to OpChat.") else arrInvite[string.lower(nick)] = nil user:SendPM(sOpChat, "User "..nick.." ist nicht l?nger unter uns.") if (GetItemByName(nick) ~= nil) then GetItemByName(nick):SendPM(sOpChat, "Account aufgehoben von Master "..user.sName) end SendPmToOps(sOpChat, ""..nick.." wurde ausgeladen von Master "..user.sName) SaveToFile(sFolder.."/"..fInvite , arrInvite , "arrInvite") end end, ["del"] = function(user,data) local s,e,i = string.find(data,"%b<>%s+%S+%s+(%S+)") if i then if Releases[tonumber(i)] then table.remove(Releases,i) SaveToFile(fRelease,Releases,"Releases") user:SendPM(sOpChat,"Address "..i..". wurde erfolgreich gel?scht!") else user:SendPM(sOpChat,"*** Error: Dieser Eintrag ist nicht vorhanden: "..i..".") end else user:SendPM(sBot,"*** Error: Type +del ") end end, } [COLOR=red]if tCmds[cmd] then if user.bOperator or arrInvite[string.lower(user.sName)] then return tCmds[cmd](user,data),1 else return user:SendData(sBot,"*** Error: You are not allowed to use this command."),1 end elseif mCmds[cmd] then if user.iProfile == 0 then return mCmds[cmd](user,data),1 else return user:SendData(sBot,"*** Error: You are not allowed to use this command."),1 end end[/COLOR] local _,_,whoTo = string.find(data,"$To:%s+(%S+)") if (whoTo == sOpChat) then if (user.bOperator or arrInvite[string.lower(user.sName)] ~= nil) then SendTalkToOps(data) SendTalkToInvited(data) return 1 else user:SendPM(sOpChat, "Du hast in diesem Bereich keinen Zutritt.") return 1 end end end ToArrival = ChatArrival SendTalkToOps = function(data) local s,e,from,talk = string.find(data, "$To:%s+%S+%s+From:%s+(%S+)%s+$%b<>%s+(.+)") local aux,profile,usr if (from ~= nil and talk ~= nil) then SaveToLog(from, talk) for aux, profile in GetProfiles() do for aux, usr in GetUsersByProfile(profile) do if (GetItemByName(usr) ~= nil and GetItemByName(usr).bOperator and GetItemByName(usr).sName ~= from) then SendToNick(GetItemByName(usr).sName, "$To: "..GetItemByName(usr).sName.." From: "..sOpChat.." $<"..from.."> "..talk) end end end end end
 

Changed teh red passage, but there is now syntag error:

heaven.lua:165: expected near `end'

GrinSlaW

it should be like this it works for me  8)

if tCmds[cmd] then

				if user.bOperator or arrInvite[string.lower(user.sName)] then

					return tCmds[cmd](user,data),1 

				else

					return user:SendData(sBot,"*** Error: You are not allowed to use this command."),1

				end

			elseif mCmds[cmd] then

				if user.iProfile == 0 then

					return mCmds[cmd](user,data),1 

				else

					return user:SendData(sBot,"*** Error: You are not allowed to use this command."),1

				end				

			end

		end

	end

	local _,_,whoTo = string.find(data,"$To:%s+(%S+)")

	if (whoTo == sOpChat) then
.:: AcExtreme ::. | .:: AcPro ::.

jiten

QuoteChanged teh red passage, but there is now syntag error:

heaven.lua:165: expected near `end'
There are two "end" missing after the red part, just like Grinslaw posted ;)

Best regards

Krysalis

argh.....sure *g*

Thanks ;-)

Krysalis

Syntax ...tor\Desktop\0.3.3.0.b17.05.nt.rls\scripts\heaven.lua:45: attempt to index field `?' (a nil value)

received this today. What can it be?

Line 41:
   arrLog[user.sName]["Mode"] = "online"
Line 45:
   arrLog[user.sName]["Mode"] = "offline"

greets

jiten

QuoteOriginally posted by Krysalis
Syntax ...tor\Desktop\0.3.3.0.b17.05.nt.rls\scripts\heaven.lua:45: attempt to index field `?' (a nil value)

received this today. What can it be?

Line 41:
   arrLog[user.sName]["Mode"] = "online"
Line 45:
   arrLog[user.sName]["Mode"] = "offline"

greets
It has to do with this table:
arrOpLevel = {						-- Put here the profile with operator privileges and its respective level
	["Master"] = 0,
	["Operator"] = 1,
}
You should fill it with every profile with Operator privileges and then run the script. If it is incorrectly set up, you will get that kind of syntax error.

Cheers

Krysalis

QuoteOriginally posted by jiten
It has to do with this table:
arrOpLevel = {						-- Put here the profile with operator privileges and its respective level
	["Master"] = 0,
	["Operator"] = 1,
}
You should fill it with every profile with Operator privileges and then run the script. If it is incorrectly set up, you will get that kind of syntax error.

Cheers

With Profiles with Operator Privileges u mean all Profiles with Key? Or all who have the ability to kick?

jiten

QuoteOriginally posted by Krysalis
With Profiles with Operator Privileges u mean all Profiles with Key? Or all who have the ability to kick?
The first one, everyone with the Key ;)

Cheers

jiten

Well, I decided to remove and optimize the arrOpLevel table. Now, there's no need for it.
Last script updated with it.

Cheers

Krysalis

ah...then i know...and now i know also my ProfileNrs....but dont know the right way to find aut which profile is which profile nr.
Can u exlain me this? I would not only bring this to work, i try to understand...but i dont find anything where i can read which Profile has which nr.
Find out with Upgrade script from madman, but this can?t be the right way *g*

Greets

Krysalis

Thats cool. Can i update with change only some parts?
Or are there more changes?

SMF spam blocked by CleanTalk