OPCHAT SCRIPT
 

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 SCRIPT

Started by GaMeFaNaTiC, 28 October, 2003, 16:10:58

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

GaMeFaNaTiC


pHaTTy

huh, tis built into the hub software, just enable it icecube 4 above i think
Resistance is futile!

GaMeFaNaTiC

ye itz ther but it doesnt seem to work :S. no other op can recieive a msg wen u write smin in ther :S.

pHaTTy

Resistance is futile!

raz

u should try downloading the software again. or the script which does vipchat u can change it 2 opchat. i can't be bothered uploading it so i will upload it afterwards. :D

raz

here it is. i have changed it so it is like opchat.

BotName = "{?2?M}?OpChat" 

function Main() 
frmHub:RegBot(BotName) 
end 

function DataArrival(curUser,data) 
local MessageRecognized = 0 

if isPM(data)==1 then 
whoto,from,message=ParsePM(data) 
MessageRecognized=1 
end 

if MessageRecognized==1 and whoto==BotName then 
if (curUser.iProfile>=0 and curUser.iProfile<=2) then 
local sus=GetUsersByProfile("Master") 
local sops=GetUsersByProfile("SuperOp") 
local ops=GetUsersByProfile("Operator") 

for i, n in sops do 
if n == curUser.sName then 
else 
SendPmToNick(n, BotName, from.." -> "..message) 
end 
end 

for i, n in sus do 
if n == curUser.sName then 
else 
SendPmToNick(n, BotName, from.." -> "..message) 
end 
end 

for i, n in ops do 
if n == curUser.sName then 
else 
SendPmToNick(n, BotName, from.." -> "..message) 
end 
end 
end
end
end

function ParsePM(data) 
s,e,whoTo,from,message = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.*)") 
message = strsub(message,1,strlen(message)-1) 
return whoTo,from,message 
end 

function isPM(data) 
if( strsub(data, 1, 3) == "$To" ) then 
return 1 
else 
return 0 
end 
end

Tuben

Or maybe this ??

I dont now but this works werry nice ;)

BOT_Chat = "Op-Chat"

function Main()
frmHub:RegBot(Bot_Chat)
end
function DataArrival(curUser,sdata)

if curUser.iProfile == 0 or curUser.iProfile == 1 then 
 if strsub(sdata, 1, 5) == "$To: " and strsub(sdata, 6, strlen(BOT_Chat) + 5) == BOT_Chat then 
sdata = strsub(sdata, 1, strlen(sdata) - 1) 
   local _,_,whoTo,from,msg = strfind(sdata,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.+)") 
	aProfiles = GetProfiles()
	 for i = 0, getn(aProfiles) do 
	  if aProfiles[i] == "Master" or
	     aProfiles[i] == "Operator" then	     
		local aUsers = GetUsersByProfile(aProfiles[i]) 
				for i = 0, getn(aUsers) do 
			if aUsers[i] ~= from then 
				local user = GetItemByName(aUsers[i]) 
			if user then 
				user:SendData("$To: "..aUsers[i].." From: "..BOT_Chat.." $<"..from.."> "..msg)
			end
		     end 
		   end
                 end
	       end
             end
	   end
	 end
-Dark-Mind-[ DOWNLOAD ]

SMF spam blocked by CleanTalk