need help from Plop
 

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 from Plop

Started by Ubikk, 21 December, 2004, 09:06:09

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ubikk

Hello there

I have downloaded a banner script from plop's website //www.plop.nl

This is the script:

Quote-- places a scrolling text in the bot's name.
-- looks nice but takes a lot of bandwidth.
-- plop


string = "   Welcome to Heaven   "
   

stringloop = string
length = 20
speed = 1300

function Main()
   SetTimer(speed)
   StartTimer()
   stringloop = gsub(stringloop, " ", " ")
end

function OnTimer()
   if T == nil then
      T = strsub(stringloop, 1, length)
      frmHub:RegBot("<  "..T.."  >")
   else
      frmHub:UnregBot("<  "..T.."  >")
      stringloop = strsub(stringloop, 2, -1)
      if strlen(stringloop) < length then
         stringloop = stringloop.." "..string
      end
      T = strsub(stringloop, 1, length)
      frmHub:RegBot("<  "..T.."  >")
   end
end

function OnExit()
   frmHub:UnregBot("<  "..T.."  >")
end

function DataArrival(user, data)
   if( strsub(data, 1, 1) == "<" ) then
      if user.iProfile == 0 then
         local s,e,cmd,onoff = strfind(data,"^%b<>%s+(%S+)%s*(%S*)")
         user:SendData(cmd)
         if cmd == "!restartscripts" then
            frmHub:UnregBot("-->"..T.."<--")
            StopTimer()
         elseif cmd == "!light" then
            user:SendData(onoff)
            if onoff == "on" then
               --SetTimer(speed)
               T = nil
               StartTimer()
               User:SendData(" started")
               return 1
            elseif onoff == "off" then
               StopTimer()
               frmHub:UnregBot("-->"..T.."<--")
               T = nil
               User:SendData(" stopped")
               return 1
            end
         end
      --else
         --user:SendData(" user level 2 low")
      end
   end
end


The scripts works fine but I've noticed a little bug while running it.

As long as the scripts runs, all the users that talk in the mainchat get an echo for each line they write or something like that. Here's an example:


[12:38] va
[12:38] va merge netu?
[12:38] <[Xana][dacia]ssir_kon> nuuuuuuuuuuuuuuuuuuuuu
[12:38] acuma
[12:38] acuma a picat?
[12:38] <[Xana][dacia]ssir_kon> da ce draq are
[12:39] mda
[12:39] mda
[12:39] astas
[12:39] astas e
[12:39] :)
[12:39] :)

I am the only one that can see my echo, but that doesnt make it less annoying. Can somebody help me, please? :(.

P.S: I'm 100% that this error is from that script ;)

plop

that was some left over debugging stuff.
i made this script just for the fun, the bandwidth usage is really high.
40KB/s upload from this script on 200 users.
-- places a scrolling text in the bot's name.
-- looks nice but takes a lot of bandwidth.
-- my advice is never 2 use this, i made it just for fun.
-- plop


string = "Pride, Porn ?n Prejudice. Come on folks the show begins. A movie full of whores ?n pimps. "..
   "Turn out the lights ?n start the reel. Check out who?s the imbecile. Come on folks just come right in. "..
   "To the weirdest place you?ve ever been. Get your tickets at the door. You?ve never seen such filth before. "..
   "Welcome! Welcome to the SINema. Welcome! Hey you kids, just dig around. Show the host what you just found. "..
   "Don?t you fear, just bring it in. There?s room enough in the house of sin. I don?t like the movie in this SINema. "..
   "I don?t like the movie in this SINema. I don?t like the movie. I don?t like the movie. I don?t like the movie in this SINema. "..
   "Where?s Stallone or Spiderman. I didn?t see this scene in Cannes. Where is Chan or Superman. Save us all? "..
   "Welcome, welcome to the SINema. Sit back, relax, enjoy the show! Welcome!"

stringloop = string
length = 20
speed = 500

function Main()
   SetTimer(speed)
   StartTimer()
   stringloop = gsub(stringloop, " ", "_")
end

function OnTimer()
   if T == nil then
      T = strsub(stringloop, 1, length)
      frmHub:RegBot("-->"..T.."<--")
   else
      frmHub:UnregBot("-->"..T.."<--")
      stringloop = strsub(stringloop, 2, -1)
      if strlen(stringloop) < length then
         stringloop = stringloop.." "..string
      end
      T = strsub(stringloop, 1, length)
      frmHub:RegBot("-->"..T.."<--")
   end
end

function OnExit()
   frmHub:UnregBot("-->"..T.."<--")
end

function DataArrival(user, data)
   if( strsub(data, 1, 1) == "<" ) then 
      if user.iProfile == 0 then
         local s,e,cmd,onoff = strfind(data,"^%b<>%s+(%S+)%s*(%S*)")
         if cmd == "!restartscripts" then
            frmHub:UnregBot("-->"..T.."<--")
            StopTimer()
         elseif cmd == "!light" then
            if onoff == "on" then
               T = nil
               StartTimer()
               User:SendData(" started")
               return 1
            elseif onoff == "off" then
               StopTimer()
               frmHub:UnregBot("-->"..T.."<--")
               T = nil
               User:SendData(" stopped")
               return 1
            end
         end
      end
   end
end

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Ubikk

My hub is very small.. it usually has 20-30 users :D

How much bandwith does that consume? :)

Ubikk

P.S: Why shouldn't use it.. it looks so darn nice 8)

plop

QuoteOriginally posted by Ubikk
P.S: Why shouldn't use it.. it looks so darn nice 8)
with the default length i set, this script uses 80 bytes per second upload PER user.
in your hub it takes between 1.6 and 2.3 KB/s.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

SMF spam blocked by CleanTalk