PtokaX forum

Archive => Archived 4.0 boards => Help with Lua 4 scripts => Topic started by: AlwaysConnected on 15 January, 2004, 20:10:59

Title: PM only to Users not to OPS how to change
Post by: AlwaysConnected on 15 January, 2004, 20:10:59
Bot = "Inge"

function NewUserConnected(user)

readfrom("pm.txt")

   while 1 do

    local line = read()

        if line == nil then break end

        user:SendPM(Bot,line)

        end

        readfrom()

end

how to change it so also Ops get it ?
Title:
Post by: shipiz on 15 January, 2004, 20:15:48
function NewUserConnected(user)

readfrom("pm.txt")

   while 1 do

    local line = read()

        if line == nil then break end

        user:SendPM(Bot,line)

        end

        readfrom()

end

function NewOPConnected(user)

readfrom("pm.txt")

   while 1 do

    local line = read()

        if line == nil then break end

        user:SendPM(Bot,line)

        end

        readfrom()

end
Title:
Post by: AlwaysConnected on 15 January, 2004, 20:27:01
thnx  :D
Title:
Post by: pHaTTy on 15 January, 2004, 21:20:26
QuoteOriginally posted by shipiz
function NewUserConnected(user)

readfrom("pm.txt")

   while 1 do

    local line = read()

        if line == nil then break end

        user:SendPM(Bot,line)

        end

        readfrom()

end

function NewOPConnected(user)

readfrom("pm.txt")

   while 1 do

    local line = read()

        if line == nil then break end

        user:SendPM(Bot,line)

        end

        readfrom()

end

function NewOPConnected(user) ???

function OpConnected(user)
Title:
Post by: pHaTTy on 15 January, 2004, 21:22:39
but uising functions is much better and more effiecent ;)


Bot = "Inge"

function NewUserConnected(user)
ToSend(user)
end

function OpConnected(user)
ToSend(user)
end


function ToSend(user)
readfrom("pm.txt")
while 1 do
local line = read()
if line == nil then
break
end
user:SendPM(Bot,line)
end
readfrom()
end


l8rr
Title:
Post by: AlwaysConnected on 15 January, 2004, 21:24:02
Gracias :) phatty :)



ok i know i lost :(
Title:
Post by: pHaTTy on 15 January, 2004, 21:40:17
QuoteOriginally posted by AlwaysConnected
ok i know i lost :(

LOL dont worry i will still return :P
Title:
Post by: raz on 15 January, 2004, 21:42:14
yo AC u haven't cuz phatty forgot 2 add regbot command i would do it but can't be bothered lol. :D
Title:
Post by: pHaTTy on 15 January, 2004, 21:45:07
QuoteOriginally posted by raz
yo AC u haven't cuz phatty forgot 2 add regbot command i would do it but can't be bothered lol. :D

well actually, its not needed, its a client issue why they dont get pm, not script :P, bue he means the checkers game we had ;)

errm and if he has another bot that already does it i guess he not need it if he does then


function Main()
          frmHub:RegBot(Bot)
end

Title:
Post by: xjr13sp on 16 January, 2004, 17:01:21
Bot = "Inge"

function NewUserConnected(user)
ToSend(user)
end

function OpConnected(user)
ToSend(user)
end


function ToSend(user)
readfrom("pm.txt")
while 1 do
local line = read()
if line == nil then
break
end
user:SendPM(Bot,line)
end
readfrom()
end

you can do also :
QuoteOpConnected = NewUserConnected
just after NewUserConnected