need help with my Bot - Page 2
 

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

need help with my Bot

Started by Themaster, 16 November, 2004, 16:57:07

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Themaster

i do not have a error in my script...i can't use all my command in main...but when i do it in PM it show 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

nErBoS

Hi,

Try to send the variable cmd and data to the main before going to the function Command.

Eg.: "SendToAll(BotName, "CMD: "..cmd)"

And see if is sending the right cmd and data. Post here them.

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

Themaster

#27
when i do help in PM i got this now

[21:32:48] <-Wesly?->  	 You are not allowed to use this command
[21:32:48] <-Wesly?-> CMD: +help

i still dead in PM...don't not what wrong more :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

nErBoS

Hi,

I have organized your data arrival, try out to use this one...

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) == "<" or strsub(data,1,5+strlen(BotName)) == "$To: "..BotName) then
		local data = strsub(data,1,strlen(data)-1)
		local _,_,cmd= strfind(data, "%b<>%s+(%S+)")
		local _,_,talk = strfind(data, "%b<>%s+(.*)")
		SendToAll(BotName, "DATA: "..data) -- To see dat sent
		SendToAll(BotName, "CMD: "..cmd) -- To see command typed
		Commands(user, data, cmd)
		if not iscommand(talk) then
			if (user.bOperator) then
				DoUpdOpStats(user,talk)
			else
				DoUpdUserStats(user,talk)
			end
		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 == OpChat then
			if user.bOperator then
				local s,e,msg = strfind(text,"^%b<>%s+(.+)")
				OpChatRoom(user,msg)
			end
		elseif 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
	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)
		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
end

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

Themaster

#29
Nope it dosen't work..all my command is DEAD now
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

nErBoS

Hi,

When you type anything or a command in main or PM the bot doesn't send anything ???

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

Themaster

#31
on Main

[07:14:14] <-Wesly?-> DATA:  +help
[07:14:14] <-Wesly?-> CMD: help

on PM
[07:14:23] <-Wesly?->  	 You are not allowed to use this command
[07:14:23] <-Wesly?->  CMD: +help

That what happen...but it still work in main
But when i do help on PM with out prefix 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

nErBoS

#32
Hi,

Try out this one...

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) == "<" or strsub(data,1,5+strlen(BotName)) == "$To: "..BotName) then
		local data = strsub(data,1,strlen(data)-1)
		local _,_,cmd= strfind(data, "%b<>%s+(%S+)")
		local _,_,talk = strfind(data, "%b<>%s+(.*)")
		if (Tprefix[strsub(cmd,1,1)] ~= nil) then
			cmd = strsub(cmd,2,strlen(cmd))
		end
		SendToAll(BotName, "DATA: "..data) -- To see dat sent
		SendToAll(BotName, "CMD: "..cmd) -- To see command typed
		Commands(user, data, cmd)
		if not iscommand(talk) then
			if (user.bOperator) then
				DoUpdOpStats(user,talk)
			else
				DoUpdUserStats(user,talk)
			end
		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 == OpChat then
			if user.bOperator then
				local s,e,msg = strfind(text,"^%b<>%s+(.+)")
				OpChatRoom(user,msg)
			end
		elseif 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
	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)
		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
end

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

nErBoS

Hi,

I have fixed a little code error on the code above.

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

Themaster

Sry mate but now my command is dead.. Nothing 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

nErBoS

Hi,

Does the script editor shows any error ???

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

Themaster

there are no error on the ptokax
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

#37
i got a dead Opchat...it won't send 2 other ops

this is on my dataarival
     if to == OpChatName then
         if user.iProfile == 0 or user.iProfile == 1 or user.iProfile == 4 then
            local s,e,msg = strfind(arg,"^%b<>%s+(.+)")
            OpChatRoom(user,msg)
			end
      end
function OpChatRoom(user,msg)
      local allprofiles = GetProfiles()
      local index, profile, index2, nick
      for index, profile in allprofiles do
         local users = GetUsersByProfile(profile)
         for index2, nick in users do
            local usr = GetItemByName(nick)
            if usr ~= nil then
               if user.sName == usr.sName then
               else
                  if usr.iProfile == 0 or usr.iProfile == 1 or usr.iProfile == 4 then
                     usr:SendData("$To: "..usr.sName.." From: "..OpChat.." $<"..user.sName.."> " ..msg)
                  end
               end
            end
         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

bastya_elvtars

-- when an op connects, store his name in a table, the table will be saved in a metafile.
-- check out chatrooms by tezlo
Everything could have been anything else and it would have just as much meaning.

Themaster

#39
k...i will try agian...But that i load a opchat what i can see
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

Help...it still DEAD :(
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