Author Topic: greeting script  (Read 2030 times)

0 Members and 1 Guest are viewing this topic.

Offline Aragorn

  • Member
  • ***
  • Posts: 31
  • Karma: +2/-0
greeting script
« on: 02 November, 2008, 07:56:39 »
I have made a short script for sending a greeting message to specific profiles but well actually it's not working. it is my first script and it would be nice if someone could fix it cause I am stuck. thanks

Code: [Select]
AllowedProfiles = {
[0] = 1, -- Owner
[1] = 2, -- Masters
[2] = 3, -- SuperUser
[3] = 4, -- Operator
[4] = 5, -- KVIP
[5] = 0, -- VIP
[6] = 0, -- Reg
[7] = 0, -- UnReg
}




function UserConnected(user)
Core.GetUserAllData(user)

if AllowedProfiles[user.iProfile] == 1 or AllowedProfiles[user.iProfile] == 2 or AllowedProfiles[user.iProfile] == 3 or AllowedProfiles[user.iProfile] == 4 or AllowedProfiles[user.iProfile] == 5 then
  if AllowedProfiles[user.iProfile] == 1 then
     Core.SendToAll("---A intrat Owner-ul " ..user.sNick.. ". Aveti grija---\r\n\r\n")
Core.SendToNick(user.sNick,"??? ?????? Bine ai venit Owner -?  " ..user.sNick.. "  ?-. Simte-te bine pe hub.Ip-ul tau este:" ..user.sIP
.. "  ?????? ???\r\n\r\n")
  end
  if AllowedProfiles[user.iProfile] == 2 then
     Core.SendToAll("---A intrat Master-ul " ..user.sNick.. ". Aveti grija---\r\n\r\n")
Core.SendToNick(user.sNick,"??? ?????? Bine ai venit Master -?  " ..user.sNick.. "  ?-. Simte-te bine pe hub.Ip-ul tau este:" ..user.sIP
.. "  ?????? ???\r\n\r\n")
  end
  if AllowedProfiles[user.iProfile] == 3 then
     Core.SendToAll("---A intrat SuperUser-ul " ..user.sNick.. ". Aveti grija---\r\n\r\n")
Core.SendToNick(user.sNick,"??? ?????? Bine ai venit SuperUser -?  " ..user.sNick.. "  ?-. Simte-te bine pe hub.Ip-ul tau este:" ..user.sIP
.. "  ?????? ???\r\n\r\n")
  end
  if AllowedProfiles[user.iProfile] == 4 then
     Core.SendToAll("---A intrat OP-ul " ..user.sNick.. ". Aveti grija---\r\n\r\n")
Core.SendToNick(user.sNick,"??? ?????? Bine ai venit OP -?  " ..user.sNick.. "  ?-. Simte-te bine pe hub.Ip-ul tau este:" ..user.sIP
.. "  ?????? ???\r\n\r\n")
  end
  if AllowedProfiles[user.iProfile] == 5 then
     Core.SendToAll("---A intrat KVIP-ul " ..user.sNick.. ". Aveti grija---\r\n\r\n")
Core.SendToNick(user.sNick,"??? ?????? Bine ai venit KVIP -?  " ..user.sNick.. "  ?-. Simte-te bine pe hub.Ip-ul tau este:" ..user.sIP
.. "  ?????? ???\r\n\r\n")
  end
end

OpConnected = UserConnected
RegConnected = UserConnected

I use ptokax 0.4.1.1 and I get this error: [08:58] Syntax E:\HubSoft\0411\scripts\greet.lua:47: 'end' expected (to close 'function' at line 15) near '<eof>' (and there might be a lot more lol)
« Last Edit: 02 November, 2008, 07:58:54 by Aragorn »
ara

PtokaX forum

greeting script
« on: 02 November, 2008, 07:56:39 »

Offline ?StIfFLEr??

  • Triple Ace
  • **
  • Posts: 241
  • Karma: +17/-63
Re: greeting script
« Reply #1 on: 02 November, 2008, 10:55:45 »
i think u forgot to end the program:P
i just added one more end
see if it works
Code: [Select]
AllowedProfiles = {
[0] = 1, -- Owner
[1] = 2, -- Masters
[2] = 3, -- SuperUser
[3] = 4, -- Operator
[4] = 5, -- KVIP
[5] = 0, -- VIP
[6] = 0, -- Reg
[7] = 0, -- UnReg
}
function UserConnected(user)
Core.GetUserAllData(user)

if AllowedProfiles[user.iProfile] == 1 or AllowedProfiles[user.iProfile] == 2 or AllowedProfiles[user.iProfile] == 3 or AllowedProfiles[user.iProfile] == 4 or AllowedProfiles[user.iProfile] == 5 then
  if AllowedProfiles[user.iProfile] == 1 then
     Core.SendToAll("---A intrat Owner-ul " ..user.sNick.. ". Aveti grija---\r\n\r\n")
Core.SendToNick(user.sNick,"??? ?????? Bine ai venit Owner -?  " ..user.sNick.. "  ?-. Simte-te bine pe hub.Ip-ul tau este:" ..user.sIP
.. "  ?????? ???\r\n\r\n")
  end
  if AllowedProfiles[user.iProfile] == 2 then
     Core.SendToAll("---A intrat Master-ul " ..user.sNick.. ". Aveti grija---\r\n\r\n")
Core.SendToNick(user.sNick,"??? ?????? Bine ai venit Master -?  " ..user.sNick.. "  ?-. Simte-te bine pe hub.Ip-ul tau este:" ..user.sIP
.. "  ?????? ???\r\n\r\n")
  end
  if AllowedProfiles[user.iProfile] == 3 then
     Core.SendToAll("---A intrat SuperUser-ul " ..user.sNick.. ". Aveti grija---\r\n\r\n")
Core.SendToNick(user.sNick,"??? ?????? Bine ai venit SuperUser -?  " ..user.sNick.. "  ?-. Simte-te bine pe hub.Ip-ul tau este:" ..user.sIP
.. "  ?????? ???\r\n\r\n")
  end
  if AllowedProfiles[user.iProfile] == 4 then
     Core.SendToAll("---A intrat OP-ul " ..user.sNick.. ". Aveti grija---\r\n\r\n")
Core.SendToNick(user.sNick,"??? ?????? Bine ai venit OP -?  " ..user.sNick.. "  ?-. Simte-te bine pe hub.Ip-ul tau este:" ..user.sIP
.. "  ?????? ???\r\n\r\n")
  end
  if AllowedProfiles[user.iProfile] == 5 then
     Core.SendToAll("---A intrat KVIP-ul " ..user.sNick.. ". Aveti grija---\r\n\r\n")
Core.SendToNick(user.sNick,"??? ?????? Bine ai venit KVIP -?  " ..user.sNick.. "  ?-. Simte-te bine pe hub.Ip-ul tau este:" ..user.sIP
.. "  ?????? ???\r\n\r\n")
end
end
end

OpConnected = UserConnected
RegConnected = UserConnected

Offline ?StIfFLEr??

  • Triple Ace
  • **
  • Posts: 241
  • Karma: +17/-63
Re: greeting script
« Reply #2 on: 02 November, 2008, 10:56:56 »
the script is working here with me see if it works for u:P
i hope i saved American Idiots time...
« Last Edit: 02 November, 2008, 11:00:26 by ?StIfFLEr?? »

Offline Aragorn

  • Member
  • ***
  • Posts: 31
  • Karma: +2/-0
Re: greeting script
« Reply #3 on: 02 November, 2008, 18:05:29 »
Thank you very much. I am just beggining to understand lua so I make mistakes :P
ara

Offline ?StIfFLEr??

  • Triple Ace
  • **
  • Posts: 241
  • Karma: +17/-63
Re: greeting script
« Reply #4 on: 02 November, 2008, 19:39:08 »
no problem buddy even m learning currently till now wasnt tat sure tat i can help in scripts but for the starters ur script was nice to do with... i hope this start takes me way ahead....

PtokaX forum

Re: greeting script
« Reply #4 on: 02 November, 2008, 19:39:08 »