greeting script
 

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

greeting script

Started by Aragorn, 02 November, 2008, 07:56:39

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Aragorn

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

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

?StIfFLEr??

i think u forgot to end the program:P
i just added one more end
see if it works
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


?StIfFLEr??

#2
the script is working here with me see if it works for u:P
i hope i saved mutors time...

Aragorn

Thank you very much. I am just beggining to understand lua so I make mistakes :P
ara

?StIfFLEr??

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

SMF spam blocked by CleanTalk