!deop function + combining scripts
 

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

!deop function + combining scripts

Started by Ubikk, 17 January, 2005, 21:28:23

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ubikk

Hey guys.
First of all I need a script with !deop command.
PtokaX is really weird. It has an !op command, but not an !deop one. Anyway, I really need this command, because on my hub I have lots of temporary ops and I would to remove their op acces without kick them or making them reconnect.

Second of all I would really need to know how to combine little scripts into bigger ones.
Here are some of my scripts. They're very little and I would apreciata if someone would teach me how to combine them

QuoteBot = "robotzel"
counter = 1

function DataArrival(user, data)
   if ( strsub(data, 1, 1) == "<" ) then
      if curname then
         if curname == user.sName then
            counter = counter + 1
            if counter >= 12 then
               SendToAll(Bot, user.sName..", vorbesti singur(a) ? :)")
               counter = 1
            end
         else
            curname = user.sName
            counter = 1
         end
      else
         curname = user.sName
         counter = 1
      end
   end
end








---------------------------------------------------


Here is the second script:





function DataArrival(user, data)
   data=strsub(data,1,strlen(data)-1)
   s,e,cmd,arg = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
   if (cmd=="!kiss") then
      if not (arg==nil) then
         local tmp = GetItemByName(arg)
         if (tmp==nil) then
            SendToAll(""..user.sName.." tries to kiss   "..arg..", but he/she smakes them in the head!")
         end
         if not (tmp==nil) then
            SendToAll("***"..user.sName.." kisses "..arg.." and they start blushing :)")
         end
         return 1
      end
   end
end




---------------------------------------------------


The 3rd one:



botname="kiss"

function DataArrival(user, data)
   data=strsub(data,1,strlen(data)-1)
   s,e,cmd,arg = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
   if (cmd=="!love") then
      if not (arg==nil) then
         local tmp = GetItemByName(arg)
         if (tmp==nil) then
            SendToAll(""..user.sName.." tries to make love but   "..arg..",  smakes them in the head!")
         end
         if not (tmp==nil) then
            SendToAll("***"..user.sName.." is making love to  "..arg.." and they are screeming!! :)")
         end
         return 1
      end
   end
end








------------------------------------------------


The 4th one:



botname="robotzel"

function DataArrival(user, data)
   data=strsub(data,1,strlen(data)-1)
   s,e,cmd,arg = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
   if (cmd=="!slap") then
      if not (arg==nil) then
         local tmp = GetItemByName(arg)
         if (tmp==nil) then
            SendToAll("***"..user.sName.." slaps "..arg.." with love ... :)")
         end
         if not (tmp==nil) then
            SendToAll("***"..user.sName.." slaps "..arg.." a bit with a large trout")
         end
         return 1
      end
   end
end






------------------------------------------------------------------------



The 5th one:



--ScreenCleaner.lua 1.1 by yepyepyep4711 and Hawk
--!cls will wipe the main chat clean (does that remind you of something? ;) )
--the command will be added to the rightclick menu of the OPs (optional)



botname = "robotzel"

rightclick = 0 -- if anything else than 1 rightclick menu won't appear

function DataArrival (curUser, sData)
command=strsub(sData,1,strlen(sData)-1)
s,e,cmd = strfind(command,"%b<>%s+(%S+)")
   if curUser.bOperator then
      if cmd=="!cls" then
         temp = "\r\n"
         for i=1,200,1 do
            temp = temp.."\r\n"
         end
         SendToAll(botname, temp)
      end
   end
end



function OpConnected(curUser)
   if rightclick == 1 then
      curUser:SendData("$UserCommand 255 7")
      curUser:SendData("$UserCommand 0 3")
      curUser:SendData("$UserCommand 1 2 Clear Screen$<%[mynick]> !cls|")
   end
end




-----------------------------------------------------------

These are just few of my scripts. The thing is I would like to combine all of my scripts into 3-4 big ones :)
Is that possible? :D

Madman

hopefully i understood you right, and you wanted 2 join thoose 5 script in to 1

Here is a Little guide

Quote---- Combined
-- Start by making the 5th one into same scripting way..
-- curUser changed 2 user
-- sData changed 2 data
-- command=strsub(data,1,strlen(data)-1) changed to data=strsub(data,1,strlen(data)-1)
-- s,e,cmd = strfind(command,"%b<>%s+(%S+)") changed 2 s,e,cmd = strfind(data,"%b<>%s+(%S+)")

---- Combined2
-- Now lets remove all Unnessacery botnames
-- left is the Bot in the 1st script, to make it simple, let change that 2 botname

---- Combined3
-- Lets move all DataArrivals togheter
-- And rightclick = 1 we can put under botname = "robotzel" and counter = 1

---- Combined4
-- Lets put the 2 lines in teh 5th script we replaced 2 the first script
-- Now... Lets Join the DataArrivals togheter
-- Everyting between function DataArrival(user, data) and the last end in the script should be moved

---- Combined5
-- All left over DataArrivals can be deleted
-- remove all data=strsub(data,1,strlen(data)-1) eccept the first one
-- on every "s,e,cmd,arg = " line lets add local
-- meaning --> local s,e,cmd,arg =
-- move all "local s,e,cmd,arg = " to, under the " if cmd == "! " lines
-- Remove all "The 3rd one: " lines...
-- Start PX... And no Script error should be...

Click here to get the files i edited

Hope it helps..
Now i'm of 2 my school... =)

As for the !deop i have no idea how that works....
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

SMF spam blocked by CleanTalk