just a qustien
 

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

just a qustien

Started by Themaster, 02 January, 2005, 20:49:51

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Themaster

i wonder if there are away to do prefix in command
like that here

if cmd == prefix.."myip" then
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

??????Hawk??????

hi m8  


what  exactly  do you mean  ???

Themaster

i mean that

function UserCommands(user,data,cmd)
   if cmd == prefix "+myip" then
      user:SendData(Bot, " Your Ip is -=-=> "..user.sIP)
      return 1

and then have 2 prefix
Prefix = {
["+"] = 1,
["!"] =,
}
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

??????Hawk??????

maby something like this will help

local _,_,PrefixToCheck = strfind(data, "%b<>%s+(%S)")
	 if Prefix[PrefixToCheck] then
--- Do your command checks here 
	end
using table
Prefix = { 
["+"] = 1, 
["!"] =1, 
}

Themaster

ok..i will try it out and see if i it work's
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

Themaster

Nope that did not work
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

??????Hawk??????

hmmm    works  here  m8  ....  

can  you post the  script    ...

Themaster

#7
function DataArrival(user, data)
   if (strsub(data,1,7) == "$MyINFO") then
      Tag,Speed,Share = Parse(data)
      TagCheck(Tag,Speed,Share,user)
   end
   if Kennylizednicks[user.sName] == 1 then
		text=kennytext[random(1, getn(kennytext))]
		SendToAll(user.sName, text)
		return 1
	elseif MUTE[user.sName] == 1 then
		user:SendData(Bot,"You are muted. your message has been blocked ! ! !")
		return 1
   elseif drunknicks[user.sName] == 1 then
		text=DrunkText[random(1, getn(DrunkText))]
			SendToAll(user.sName, text)
         return 1 
		end
   if (strsub(data, 1, 1) == "<" ) then
      local data=strsub(data,1,strlen(data)-1)
      local _,_,cmd=strfind(data, "%b<>%s+(%S+)")
      local Commands = (UserCommands(user, data, cmd))
      return Commands
   elseif (strsub(data,1,4) == "$To:") then
      data = strsub(data,1,-2);
      local s,e,whoTo,from,arg = strfind(data,"%$To:%s+(%S+)%s+From:%s+(%S+)%s+%$%b<>%s+(.*)")
      local s,e,cmd = strfind(arg,"(%S+)")
      if (whoTo == Bot) then 
      UserCommands(user,data,cmd)
      elseif(whoTo == fBot) then
      UserCommands(user,data,cmd)
      else
         for i=1,getn(ChatBots) do
            if (( whoTo == ChatBots[i].Name )) then
               if (( ChatBots[i].Allowed[user.iProfile] == 1 )) then
                  sChat = ChatBots[i].Name;
                  for b,v in ChatBots[i].Allowed do
                     if (( v == 1 )) then
                        ChatRoom(sChat,user,arg,b)
                     end
                  end
               end
            end
         end
      end
   end
end

function UserCommands(user,data,cmd)
   if cmd == "+myip" then
      user:SendData(Bot, " Your IP is -=-=> "..user.sIP)
      return 1
   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

??????Hawk??????

#8
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 Kennylizednicks[user.sName] == 1 then
		text=kennytext[random(1, getn(kennytext))]
		SendToAll(user.sName, text)
		return 1
	elseif MUTE[user.sName] == 1 then
		user:SendData(Bot,"You are muted. your message has been blocked ! ! !")
		return 1
   elseif drunknicks[user.sName] == 1 then
		text=DrunkText[random(1, getn(DrunkText))]
			SendToAll(user.sName, text)
         return 1 
		end
   if (strsub(data, 1, 1) == "<" ) then
      local data=strsub(data,1,strlen(data)-1)
      local _,_,PrefixToCheck=strfind(data, "%b<>%s+(%S)")
	if Prefix[PrefixToCheck] then
      		local _,_,cmd=strfind(data, "%b<>%s+%S(%S+)")
      		local Commands = (UserCommands(user, data, cmd))
      		return Commands
	end
   elseif (strsub(data,1,4) == "$To:") then
      data = strsub(data,1,-2);
      local s,e,whoTo,from,arg = strfind(data,"%$To:%s+(%S+)%s+From:%s+(%S+)%s+%$%b<>%s+(.*)")
      local s,e,cmd = strfind(arg,"(%S+)")
      if (whoTo == Bot) then 
      UserCommands(user,data,cmd)
      elseif(whoTo == fBot) then
      UserCommands(user,data,cmd)
      else
         for i=1,getn(ChatBots) do
            if (( whoTo == ChatBots[i].Name )) then
               if (( ChatBots[i].Allowed[user.iProfile] == 1 )) then
                  sChat = ChatBots[i].Name;
                  for b,v in ChatBots[i].Allowed do
                     if (( v == 1 )) then
                        ChatRoom(sChat,user,arg,b)
                     end
                  end
               end
            end
         end
      end
   end
end




function UserCommands(user,data,cmd)
   if cmd == "myip" then
      user:SendData(Bot, " Your IP is -=-=> "..user.sIP)
      return 1
   end
end

Prefix = {
["!"] = 1,
["+"] = 1,
["?"] = 1
}

[_XStaTiC_]

You must also remove the + cmd == "+myip"  <-> cmd == "myip"

function UserCommands(user,data,cmd)
   if cmd == "myip" then
      user:SendData(Bot, " Your Ip is -=-=> "..user.sIP)
      return 1
   elseif cmd == "rules" then

Themaster

Nope it not work with ? and ! but work with +
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

??????Hawk??????

sorry   above  post  edited    ;)

Themaster

that ok..m8
i was just a test i 2 see if it will do
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

??????Hawk??????

#13
yups  all  workin  ok now  ??

you  probably  spotted  that  not only  the  prefix  from the  command   had to be removed  but it also had to be removed from the  cmd

local _,_,cmd=strfind(data, "%b<>%s+%S(%S+)")

or Ignored as in the above

SMF spam blocked by CleanTalk