PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: gOOfus on 11 January, 2004, 21:55:17

Title: user connect script for Ops, VIPs and regs
Post by: gOOfus on 11 January, 2004, 21:55:17
I need a script that states to the hub when Ops, VIPs and Regs join the hub. All I could find was a script that works for VIPs and I couldn't figure out how to change it for all. Could someone help this old noob? :(
Title:
Post by: kepp on 11 January, 2004, 22:41:18
onENTER = "-= Has entered the hub =-"
onEXIT = "-= Has left the hub =-"

function NewUserConnected(user)
   if user.iProfile == 3 then
      SendToAll(Bot, user.sName.." "..onENTER)
   elseif user.iProfile == 2 then
       SendToAll(Bot, user.sName.." "..onENTER)
    end
end


function OpConnected(user)
   SendToAll(bot, user.sName.." "..onEnter)
end

function UserDisconnected(user)
    if user.iProfile == 3 then
       SendToAll(Bot, user.sName.." "..onEXIT)
    elseif user.iProfile == 2 then
       SendToAll(Bot, user.sName.. " "..onEXIT)
    end
end

function OpDisconnected()
   SendToAll(Bot, user.sName.." "..onEXIT)
end
Title:
Post by: Devastator on 12 January, 2004, 13:58:59
i tried this script but it doesnt seem to work.

i got the follwing error:

Syntax Error: attempt to index global `user' (a nil value)
Syntax Error: attempt to concat global `onEnter' (a nil value)

which i know nothing abt

also i want 2 try adjust the above script so that users, whetehr they are registered or not reistered the ' has entered message' comes up......also i want to take out the Op enter msg as its not needed for me.

Sorry i'm so rubbish at this but i think i'm graddually learning!

please help

thanx a lot!

Devastator
Title:
Post by: kepp on 12 January, 2004, 14:08:22
onENTER = "-= Has entered the hub =-"

onEXIT = "-= Has left the hub =-"

Bot = "Botname_here"

function NewUserConnected(user)
   user:SendData(Bot, "Welcome user.sName.."\r\nYour IP: "..user.sIP)

   if user.iProfile == 3 then

      SendToAll(Bot, user.sName.." "..onENTER)

   elseif user.iProfile == 2 then

       SendToAll(Bot, user.sName.." "..onENTER)

    end

end

function UserDisconnected(user)

    if user.iProfile == 3 then

       SendToAll(Bot, user.sName.." "..onEXIT)

    elseif user.iProfile == 2 then

       SendToAll(Bot, user.sName.. " "..onEXIT)

    end

end

Sorry, was in a rush.. this should work..i checked for errors and had none so good luck!!
Title:
Post by: D-J Valhala on 12 January, 2004, 14:22:42
kepp please dont give the "-= =-" coz it's was for my hub and i dont whant that other hubs will have the same welcome as in my hub 10x

:P

CyA all
Title:
Post by: SaintSinner on 12 January, 2004, 14:28:02
QuoteOriginally posted by D-J Valhala
kepp please dont give the "-= =-" coz it's was for my hub and i dont whant that other hubs will have the same welcome as in my hub 10x

:P

CyA all

i dont think you own the copyright to  the "-= =-"
and yours is not the only hub to have that welcome.
Title:
Post by: Devastator on 12 January, 2004, 14:33:02
Syntax Error: `)' expected;
  last token read: `\' at line 8 in file ....

again i have no clue i'm jus pointin things out!


its an error thats popped up

if u can fix it thanx a lot m8 (y)
Title:
Post by: kepp on 12 January, 2004, 14:50:15
onENTER = "-= Has entered the hub =-"
onEXIT = "-= Has left the hub =-"
Bot = "Botname_here"

function NewUserConnected(user)
   user:SendData(Bot, "Welcome "..user.sName.."\r\nYour IP: "..user.sIP)
   if user.iProfile == 3 then
      SendToAll(Bot, user.sName.." "..onENTER)
   elseif user.iProfile == 2 then
       SendToAll(Bot, user.sName.." "..onENTER)
    end
end

function UserDisconnected(user)
    if user.iProfile == 3 then
       SendToAll(Bot, user.sName.." "..onEXIT)
    elseif user.iProfile == 2 then
       SendToAll(Bot, user.sName.. " "..onEXIT)
    end
end

here.. :S
Title:
Post by: Devastator on 12 January, 2004, 15:03:23
Thanx a lot m8 it works now :D

can u make it so wen all users registered or not registered sign in the same msg shows

sorry 2 b such a pain plz b kind enuff 2 change it so it appears 4 unregistered users 2! plz  :rolleyes:  :rolleyes:  :rolleyes:

Thanx a LoT i apologise 4 bein such a nusiance!

Devastator
Title:
Post by: gOOfus on 12 January, 2004, 22:53:20
Works great, thank you!
Title:
Post by: Devastator on 15 January, 2004, 18:12:10
i'm usin this script but i got

Syntax Error: attempt to concat local `iProfile' (a nil value)

i'm quite sure its with this script try fix this if u can

thanx a lot u guys r gr8!

Devastator
Title:
Post by: Devastator on 18 January, 2004, 01:15:12
cnt n e bodee help me with this?
Title:
Post by: plop on 19 January, 2004, 15:39:33
QuoteOriginally posted by Devastator
i'm usin this script but i got

Syntax Error: attempt to concat local `iProfile' (a nil value)

i'm quite sure its with this script try fix this if u can

thanx a lot u guys r gr8!

Devastator
can't see anything wrong in the script, but it's for testdrive and up.
on icecube it's logical that you get sutch an error, it doesn't have profiles yet.

plop
Title:
Post by: Devastator on 19 January, 2004, 18:05:54
i dnt use ice cube i use 0.326 TD 4...dunno wat problem is usin Robocop and MasterChat script with it also
Title:
Post by: plop on 19 January, 2004, 19:26:03
QuoteOriginally posted by Devastator
i dnt use ice cube i use 0.326 TD 4...dunno wat problem is usin Robocop and MasterChat script with it also
give this 1 a try, i placed some debugging msg's in it.
hope that can help finding whats going wrong.
onENTER = "-= Has entered the hub =-"
onEXIT = "-= Has left the hub =-"
Bot = "Botname_here"



function NewUserConnected(user)
   user:SendData(Bot, "Welcome "..user.sName.."\r\nYour IP: "..user.sIP)
   if user.iProfile then
      if user.iProfile == 3 then
         SendToAll(Bot, user.sName.." "..onENTER)
      elseif user.iProfile == 2 then
         SendToAll(Bot, user.sName.." "..onENTER)
      end
   else
      user:SendData(Bot, "whaaaaaaaaaaaaaaa problem, somehow you don't have a profile.|")
   end
end



function UserDisconnected(user)
   if user.iProfile then
      if user.iProfile == 3 then
         SendToAll(Bot, user.sName.." "..onEXIT)
      elseif user.iProfile == 2 then
         SendToAll(Bot, user.sName.. " "..onEXIT)
      end
   else
      user:SendData(Bot, "whaaaaaaaaaaaaaaa problem, somehow you don't have a profile.|")
   end
end
plop
Title:
Post by: Devastator on 19 January, 2004, 21:50:55
i jus found out that i get the error when i temp op a user and when they exit the following syntax error appears...

Syntax Error: attempt to concat local `iProfile' (a nil value)

hope that helps u 2 solve ma problem

thanx a lot

Devastator
Title:
Post by: plop on 19 January, 2004, 22:59:21
then this should solve your problem.
onENTER = "-= Has entered the hub =-"
onEXIT = "-= Has left the hub =-"
Bot = "Botname_here"



function NewUserConnected(user)
   user:SendData(Bot, "Welcome "..user.sName.."\r\nYour IP: "..user.sIP)
   if user.iProfile then
      if user.iProfile == 3 then
         SendToAll(Bot, user.sName.." "..onENTER)
      elseif user.iProfile == 2 then
         SendToAll(Bot, user.sName.." "..onENTER)
      end
   end
end



function UserDisconnected(user)
   if user.iProfile then
      if user.iProfile == 3 then
         SendToAll(Bot, user.sName.." "..onEXIT)
      elseif user.iProfile == 2 then
         SendToAll(Bot, user.sName.. " "..onEXIT)
      end
   end
end
plop
Title:
Post by: Devastator on 19 January, 2004, 23:06:50
am gonna keep sayin this until his made mod or until i go mad....sum1 make plop a mod....his just a helping machine he was born 2 help every1!....

Thanx once agen on replyin much appreciated! =)

PLOP 4 MOD!!!

^^^^^^^^

Devastator