cant get this part to work
 

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

cant get this part to work

Started by Psycho_Chihuahua, 04 September, 2004, 18:11:23

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Psycho_Chihuahua

hi i have a small prob seeming though the hub gives out no errors at all, but the function still doesnt work :(

elseif (cmd=="!hubrs") then 
			if user.iProfile == 0 then 
				SendData(BOTName, " *** HUBNACHRICHT from "..curUser..", The Hub needs to be restarted, this takes but a second so no worry's you can just reconnect. *** ")
				return 1 
			elseif user.iProfile ~== 0 then 
				user:SendPM(BOTName, "you are not allowed to use this command") 
			end 
		elseif (cmd=="!hubserverrs") then 
			if user.iProfile == 0 then 
				SendData(BOTName, " *** HUBMESSAGE from "..curUser..", The Hubserver needs to be restarted. This usually takes approx 15 minutes, after that you can all reconnect. Sorry for any inconveniences. Cya L8ter *** ")
				return 1 
			elseif user.iProfile ~== 0 then 
				user:SendPM(BOTName, "you are not allowed to use this command") 
				return 1 
			end

I got it working last night but i did something wrong with it and cant remember what  :D

it is supposed to end up here...


Edited and actual Version

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+)")
		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 
[COLOR=red]		elseif (cmd=="!hubrs") then 
			if user.iProfile == 0 then 
				SendData(BOTName, " *** HUBNACHRICHT von "..curUser..", Der Hub wird Kurz mal neugestartet, Dies dauert nur Kurz und dann k?nnt ihr gleich wieder verbinden *** ")
				return 1 
			end 
			elseif user.iProfile ~= 0 then 
				user:SendPM(BOTName, "du bist nicht befugt diesen Befehl auszuf?hren") 
				return 1 
		elseif (cmd=="!hubserverrs") then 
			if user.iProfile == 0 then 
				SendData(BOTName, " *** HUBNACHRICHT von "..curUser..", Der Hubserver wird  mal neugestartet....Dies dauert in der Regel ca 15 Minuten. Also bis gleich *** ")
				return 1 
			elseif user.iProfile ~= 0 then 
				user:SendPM(BOTName, "du bist nicht befugt diesen Befehl auszuf?hren") 
				return 1 
			end [/COLOR]
  		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,"Deine Ip lautet: "..user.sIP)
			return 1
		elseif (cmd == "!myversion" ) then
			user:SendData(BOTName,"Deine Client Version ist: "..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, "du bist nicht befugt diesen Befehl auszuf?hren") 
			end 
		elseif (cmd == "!me") then 
			AddAChatter(sUser) 
			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, "du bist nicht befugt diesen Befehl auszuf?hren") 
			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, "du bist nicht befugt diesen Befehl auszuf?hren") 
				end
			elseif (cmd == "!restartscripts") and user.iProfile == 0 then 
				return 0 
			elseif (cmd == "!restart") and user.iProfile == 0 then 
				return 0 
			end
		end

elseif strsub(data, 1,7) == "$MyINFO" and user.sName ~= "{HubListPinger}" then
      if not excludeUsers[user.sName] then
         local _,_,openhubs = strfind( data , ".+H:(%d+)" );
         if OpenCheck == 1 then
            if ( openhubs ~= "0" ) then
               SendToNick( user.sName , "Du bist in einen oder mehreren Open Hubs. Dies verst?sst gegen unsere Regeln. Deshalb wird die Verbindung zur?ckgesetzt!" )
               user:Disconnect()
            end
         end
      end
end
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Herodes

from what I notice the problem seems to be here ( noted in red)
if user.iProfile == 0 then 
				SendData(BOTName, " *** HUBNACHRICHT from "..curUser..", The Hub needs to be restarted, this takes but a second so no worry's you can just reconnect. *** ")
				return 1 
			elseif user.iProfile [color=red]~==[/color] 0 then 
				user:SendPM(BOTName, "you are not allowed to use this command") 
			end 
		elseif (cmd=="!hubserverrs") then

Psycho_Chihuahua

#2
yeah that and something else in another part of the script lol
that stupid =
 :D
thnx herodes

i now have this and it works fine
elseif (cmd=="!hubrs") then 
			if user.iProfile == 0 then 
				SendPmToAll(BOTName, "\t\t*** HUBNACHRICHT von "..user.sName.." ***\r\n\r\n\t *** Der Hub wird Kurz mal neugestartet, Dies dauert nur Kurz und dann k?nnt ihr gleich wieder verbinden *** ")
				return 1 
			elseif user.iProfile ~= 0 then 
				user:SendPM(BOTName, "du bist nicht befugt diesen Befehl auszuf?hren") 
				return 1 
			end 
		elseif (cmd=="!hubserverrs") then 
			if user.iProfile == 0 then 
				SendPmToAll(BOTName, "\t\t*** HUBNACHRICHT von "..user.sName.." ***\r\n\r\n\t *** Der Hubserver wird  mal neugestartet.... Dies dauert in der Regel etwas um die 15 Minuten. Also bis gleich *** ")
				return 1 
			elseif user.iProfile ~= 0 then 
				user:SendPM(BOTName, "du bist nicht befugt diesen Befehl auszuf?hren") 
				return 1 
			end

btw how would i have to edit these lines to make it possible as Admin to send Mass messages?
As in
("\t\t*** HUBNACHRICHT von "..user.sName.." ***\r\n\r\n\t *** Msg ***)
with Trigger !Mass? I tried once using Chill's from SL0.47  but i couldn't get it to work standalone lol
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Herodes

try instead of
if user.iProfile == 0 then
to use end in these conditions... somthing like...
*considering your admin Profile is 5
if user.iProfile == 0 or user.iProfile == 5 then

Psycho_Chihuahua

QuoteOriginally posted by Herodes
try instead of
if user.iProfile == 0 then
to use end in these conditions... somthing like...
*considering your admin Profile is 5
if user.iProfile == 0 or user.iProfile == 5 then

Not quite what i asked but still some usefull info :)

I'm still looking for an easy way to change the line to write the Message yourself
as in for example
!mass here comes the text you want to send
i've been looking for a simple standalone Mass message bot but havent found one without other stuff with it.
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Herodes

Now I understand you,...

Basically you need to catch the cmd and the msg like this ...
s,e,cmd,msg = strfind(data, "%b<>%s+(%S+)%s+(.*)")

Then use SendPmToAll(from, msg)

nErBoS

Hi,

For futher doubts take a look HERE to see what magical char can do to help you out.

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

Psycho_Chihuahua

thnx m8

any idea why this doesnt work?

SendPmToAll(BOTName,  "\t\t*** HUBNACHRICHT von "..user.sName.." ***\r\n\r\n\t ***" msg)
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

nErBoS

Hi,

There is missing this...

SendPmToAll(BOTName,  "\t\t*** HUBNACHRICHT von "..user.sName.." ***\r\n\r\n\t ***"[b]..msg[/b])

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

SMF spam blocked by CleanTalk