script help
 

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

script help

Started by Themaster, 28 December, 2004, 20:44:32

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Themaster

Hello ppl

Need some help with my script
i can't do my command in pm why....plz help me on it

function DataArrival(user,data)
   if (strsub(data,1,7) == "$MyINFO") then
      Tag,Speed,Share = Parse(data)
      TagCheck(Tag,Speed,Share,user)
   end
   if (strsub(data, 1, 1) == "<" ) then
   local data = strsub(data,1,strlen(data)-1)
   local _,_,prefix,cmd=strfind(data, "%b<>%s+(%S)(%S+)")
      if Tprefix[prefix] and cmd then
         prefixcmd = Tprefix[prefix]..cmd
         local Command = Command(user, data, cmd)
         return Command
      	elseif Kennylizednicks[user.sName] == 1 then
            text=kennytext[random(1, getn(kennytext))]
				SendToAll(user.sName, text)
				return 1
         elseif Mutes[user.sName] == 1 then
				user:SendData(BotName,"You are muted. your message has been blocked ! ! !")
				return 1
         end
      end
      if strsub(data, 1, 5) == "$To: " then
      local s,e,whoTo,from,text = strfind(data, "%$To:%s(%S+)%sFrom:%s(%S+)%s$(.*)$")
      if whoTo == BotName then
		local data=strsub(data,1,strlen(data)-1)
		local _,_,cmd = strfind(data,"$%b<>%s+(%S+)")
			if user.iProfile == 1 or user.iProfile == 0 then
         local Commands = Commands(user, data, cmd)
			return Commands
			end
      end       
      if whoTo == OpChat then
         if user.bOperator or Invited[user.sName] then 
            local s,e,msg = strfind(text,"^%b<>%s+(.+)")
            OpChatRoom(user,msg)
         end
      end
      if whoTo == MasterChat then
         if user.bOperator then
            local s,e,msg = strfind(text,"^%b<>%s+(.+)")
            MasterChatRoom(user,msg)
         end
      end
      if whoTo == PmToOps then
			local data=strsub(data,1,strlen(data)-1)
			local _,_,message = strfind(data,"$%b<>%s+(.+)")
			SendPmToOps(OpChat, "The user "..user.sName.." wants to inform us about : "..message)
			user:SendPM(PmToOps,"Your Message has been delivered to  "..OpChat.." and Ops will handle it  !! ")
         end
      end
   local tmp = strsub(data,1,1)
	if tmp == "<" then
		local s, e, str = strfind(data,"%b<> (.*)|")
		if not iscommand(str) then
			if (user.bOperator) then
				DoUpdOpStats(user,str)
			else
				DoUpdUserStats(user,str)
			end
		end
	end
	if (strsub(data,1,1) == "<" ) then 
		data=strsub(data,1,strlen(data)-1) 
		s,e,cmd = strfind( data,"%b<>%s+(%S+)" ) 
			if (cmd=="+stats")then
				pm = 0
				ShowTop15(user)
			end
	end
   if HomeMadeTimer ~= strfind(date("%M"), "^%d") then 
      HomeMadeTimer = strfind(date("%M"), "^%d") 
      lucifer = nil
      lucifer = {}
   end
   if AUTO == 1 then
      if CleanDay ~= date("%x") then -- user cleaning trigger, works as a timer without a timer
         CleanDay = date("%x")
         CleanUsers()
      end
   end
end
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

DJ Bert

Try this
function DataArrival(user,data)
   if (strsub(data,1,7) == "$MyINFO") then
      Tag,Speed,Share = Parse(data)
      TagCheck(Tag,Speed,Share,user)
   end
   if (strsub(data, 1, 1) == "<" ) then
   local data = strsub(data,1,strlen(data)-1)
   local _,_,prefix,cmd=strfind(data, "%b<>%s+(%S)(%S+)")
      if Tprefix[prefix] and cmd then
         prefixcmd = Tprefix[prefix]..cmd
         local Command = Command(user, data, cmd)
         return Command
      	elseif Kennylizednicks[user.sName] == 1 then
            text=kennytext[random(1, getn(kennytext))]
				SendPm(user.sName, text)
				return 1
         elseif Mutes[user.sName] == 1 then
				user:SendData(BotName,"You are muted. your message has been blocked ! ! !")
				return 1
         end
      end
      if strsub(data, 1, 5) == "$To: " then
      local s,e,whoTo,from,text = strfind(data, "%$To:%s(%S+)%sFrom:%s(%S+)%s$(.*)$")
      if whoTo == BotName then
		local data=strsub(data,1,strlen(data)-1)
		local _,_,cmd = strfind(data,"$%b<>%s+(%S+)")
			if user.iProfile == 1 or user.iProfile == 0 then
         local Commands = Commands(user, data, cmd)
			return Commands
			end
      end       
      if whoTo == OpChat then
         if user.bOperator or Invited[user.sName] then 
            local s,e,msg = strfind(text,"^%b<>%s+(.+)")
            OpChatRoom(user,msg)
         end
      end
      if whoTo == MasterChat then
         if user.bOperator then
            local s,e,msg = strfind(text,"^%b<>%s+(.+)")
            MasterChatRoom(user,msg)
         end
      end
      if whoTo == PmToOps then
			local data=strsub(data,1,strlen(data)-1)
			local _,_,message = strfind(data,"$%b<>%s+(.+)")
			SendPmToOps(OpChat, "The user "..user.sName.." wants to inform us about : "..message)
			user:SendPM(PmToOps,"Your Message has been delivered to  "..OpChat.." and Ops will handle it  !! ")
         end
      end
   local tmp = strsub(data,1,1)
	if tmp == "<" then
		local s, e, str = strfind(data,"%b<> (.*)|")
		if not iscommand(str) then
			if (user.bOperator) then
				DoUpdOpStats(user,str)
			else
				DoUpdUserStats(user,str)
			end
		end
	end
	if (strsub(data,1,1) == "<" ) then 
		data=strsub(data,1,strlen(data)-1) 
		s,e,cmd = strfind( data,"%b<>%s+(%S+)" ) 
			if (cmd=="+stats")then
				pm = 0
				ShowTop15(user)
			end
	end
   if HomeMadeTimer ~= strfind(date("%M"), "^%d") then 
      HomeMadeTimer = strfind(date("%M"), "^%d") 
      lucifer = nil
      lucifer = {}
   end
   if AUTO == 1 then
      if CleanDay ~= date("%x") then -- user cleaning trigger, works as a timer without a timer
         CleanDay = date("%x")
         CleanUsers()
      end
   end
end


Grtzzz
DJ Bert

Themaster

#2
Nope...it not work on the pm but in main it works

but i got this error
Syntax error: attempt to call global `Commands' (a nil value)
stack traceback:
   1:  function `DataArrival' at line 183 [file `...ettingsHub\scripts\Blade1.1.lua']

     if strsub(data, 1, 5) == "$To: " then
      local s,e,whoTo,from,text = strfind(data, "%$To:%s(%S+)%sFrom:%s(%S+)%s$(.*)$")
      if whoTo == BotName then
		local data=strsub(data,1,strlen(data)-1)
		local _,_,cmd = strfind(data,"$%b<>%s+(%S+)")
			if user.iProfile == 1 or user.iProfile == 0 then
         local Commands = Commands(user, data, cmd)
			[COLOR=red]return Commands[/COLOR] 
			end
      end  
the red are the error
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

[_XStaTiC_]

#3
I'm not sure, but i think the word Commands must be Command


        local Command = Command(user, data, cmd)
         return Command

I'm also missing the prefix command, or do you want the commands whitout the prefix in PM

Themaster

no i do have try it...
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

bastya_elvtars

Simplified:

     if strsub(data, 1, 5) == "$To: " then
	      local _,_,whoTo= strfind(data, "%$To:%s(%S+)%s+")
	      if whoTo == BotName then
			local data=strsub(data,1,strlen(data)-1)
			local _,_,cmd = strfind(data,"$%b<>%s+(%S+)")
			if user.bOperator then
				return Commands(user, data, cmd)
			end
	      end   
	  end
Everything could have been anything else and it would have just as much meaning.

Themaster

Ok...that do something...but now i got that here in main
[00:07:07]   	 You are not allowed to use this command
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

bastya_elvtars

the chunk you posted is for ops only
Everything could have been anything else and it would have just as much meaning.

Themaster

K...but the ops do have 2 use the command on pm 2 instead of main i mean both
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

bastya_elvtars

QuoteOriginally posted by Themaster
K...but the ops do have 2 use the command on pm 2 instead of main i mean both

huh?

i cannot understand - i m a bit sleepy
Everything could have been anything else and it would have just as much meaning.

Themaster

k...i'm just have try with master and ops it still the same i got in main
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

bastya_elvtars

what you are doing wrong is the following:

you wanna add features to your script. first make the core work, then it will be a pleasure to add features. so use 1 or 2 commands, make the checker... the others are easy

ask for lawmaker source @ typhoon
Everything could have been anything else and it would have just as much meaning.

Themaster

k...but i still not understan that problem i got on that
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

SMF spam blocked by CleanTalk