A little change
 

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

A little change

Started by Snoris, 22 December, 2003, 20:29:28

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Snoris

Is it possible to make this script to show the information for ONLY user.iProfile-1 (Regular user)

-- Timer bot by piglja - 25/04/03  |  Nooblike mod by GoldMember - 30/04/03

-- Editable (start)
botname = "Info"
minutes = 25
file1 = "timer/adress.txt"
file2 = "timer/any.txt"
file3 = "timer/50GB.txt"

-- Editable (end)

countmin = "2"

function Main()
SetTimer(minutes*60000)
StartTimer()
end

function OnTimer()
MessageToAll()
end

function MessageToAll()
  if countmin=="0" then
    local handle = openfile(file1, "r")
    if (handle ~= nil) then
      local line = read(handle)
      while line do
        SendToAll(botname,line)
        line = read(handle)
      end
      closefile(handle)
      countmin = "1"
    end
  elseif countmin=="1" then
    local handle = openfile(file2, "r")
    if (handle ~= nil) then
      local line = read(handle)
      while line do
        SendToAll(botname,line)
        line = read(handle)
      end
      closefile(handle)
      countmin = "2"
    end
  elseif countmin=="2" then
    local handle = openfile(file3, "r")
    if (handle ~= nil) then
      local line = read(handle)
      while line do
        SendToAll(botname,line)
        line = read(handle)
      end
    end
    closefile(handle)
    countmin = "0"
  end
end

Is there ANY1 who can help me with this little change in this script??I know its almost everyones holiday and all but maybe there is someone who can help me anyway

Snoris

No one who can help me with this??

Its no hurry but an answer at least if there is anyone who can fix this....:]

BlazeXxX

It goes something like this in ur script, but since i am not an expert in lua.. i think instead of  SendToAll(botname,line) i need something like SendTo:user.iProfile = -1  ???

 local line = read(handle)
      while line do
      if user.iProfile == -1 then
      SendToAll(botname,line)
      line = read(handle)
      end
     end
     closefile(handle)
      countmin = "1"

If i am on the right track, someone tell me how to send the msg to a specific profile? I will be able to help snoris , if someone guides me on this little doubt..

plop

easyest is 2 store all users with that level in a table, when they enter you push them in and when they leave you remove them.
now all you have 2 do on sending the msg is 2 go thru all the users in the table with:

SendToNick(nick, data) - Sends data to specified nick. If the nick is not online then it's ignored
  nick - a nickname of user you want to send data to
  data - string to send

or for pm:

SendPmToNick(to, from, data) - Sends a private message to given nick
  to - nickname you want to send the PM to
  from - who's sending the message ?
  data - string to send

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

Snoris

Sorry for the late reply and thx u guys for helping me out with this...Gonna sit down and try it out....BOTH of them ;)

SMF spam blocked by CleanTalk