How to change to 5.1
 

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

How to change to 5.1

Started by DJ Bert, 29 March, 2006, 23:42:44

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DJ Bert

What are all the things be changed for lua 5.1. Try to find some. I wil update Guardian to lua 5.1, but get some errors in section Tag in Description.

bastya_elvtars

Well, you should post the chunk and the error here in order to get help IMHO.
Everything could have been anything else and it would have just as much meaning.

DJ Bert

#2
--Description Tag by ??????Hawk?????? 27-02-2005 LUA 5 

--===Sets the tag to be shown in reg's descriptions================= 

regTagInDescription = "??????Reg??????" --\\ Tag 

--================================================================== 
--===Sets the tag to be shown in Vip's descriptions================= 

VipTagInDescription = "??????Vip??????" --\\ Tag 

--================================================================== 
--===Sets the tag to be shown in op's descriptions================== 

OpsTagInDescription = "??????Op??????" --\\ Tag 

--================================================================== 
--===Sets the tag to be shown in masters's descriptions============= 

MastersTagInDescription = "??????Master??????" --\\ Tag 

--================================================================== 
--===Sets the time for the tags to be updated======================= 

MastersTagInDescription = "??????Owner??????" --\\ Tag 

--================================================================== 

Mins = 1 

--================================================================== 



timer = 60000 * Mins 
function Main() 
	SetTimer(timer) 
	StartTimer() 
end 

function OnTimer() 
	TagInDescription() 
end 

function TagInDescription() 
	local aux,usr 
		for aux, usr in GetUsersByProfile("vip") do 
			if (GetItemByName(usr) ~= nil) then 
				local userToShow = GetItemByName(usr) 
					if (userToShow.sMyInfoString ~= nil) then 
						local s,e,name,desc,speed,email,share = string.find(userToShow.sMyInfoString, "$MyINFO $ALL (%S+)%s+([^$]*)$ $([^$]*)$([^$]*)$([^$]+)") 
						SendToAll( "$MyINFO $ALL "..name.." "..VipTagInDescription.." "..desc.."$ $"..speed.."$"..email.."$"..share.."$") 
					end 
			end 
		end 
		for aux, usr in GetUsersByProfile("operator") do 
			if (GetItemByName(usr) ~= nil) then 
				local userToShow = GetItemByName(usr) 
					if (userToShow.sMyInfoString ~= nil) then 
						local s,e,name,desc,speed,email,share = string.find(userToShow.sMyInfoString, "$MyINFO $ALL (%S+)%s+([^$]*)$ $([^$]*)$([^$]*)$([^$]+)") 
						SendToAll( "$MyINFO $ALL "..name.." "..OpsTagInDescription.." "..desc.."$ $"..speed.."$"..email.."$"..share.."$") 
					end 
			end 
		end 
		for aux, usr in GetUsersByProfile("master") do 
			if (GetItemByName(usr) ~= nil) then 
				local userToShow = GetItemByName(usr) 
					if (userToShow.sMyInfoString ~= nil) then 
						local s,e,name,desc,speed,email,share = string.find(userToShow.sMyInfoString, "$MyINFO $ALL (%S+)%s+([^$]*)$ $([^$]*)$([^$]*)$([^$]+)") 
						SendToAll( "$MyINFO $ALL "..name.." "..MastersTagInDescription.." "..desc.."$ $"..speed.."$"..email.."$"..share.."$") 
					end 
			end 
		end 
		for aux, usr in GetUsersByProfile("reg") do 
			if (GetItemByName(usr) ~= nil) then 
				local userToShow = GetItemByName(usr) 
					if (userToShow.sMyInfoString ~= nil) then 
						local s,e,name,desc,speed,email,share = string.find(userToShow.sMyInfoString, "$MyINFO $ALL (%S+)%s+([^$]*)$ $([^$]*)$([^$]*)$([^$]+)") 
						SendToAll( "$MyINFO $ALL "..name.." "..regTagInDescription.." "..desc.."$ $"..speed.."$"..email.."$"..share.."$") 
					end 
			end 
		end 
end


The error i get is in next line
for aux, usr in GetUsersByProfile("vip") do


attempt to call a table value

That is the same code what's is used in Guardian.

bastya_elvtars

for aux, usr in ipairs(GetUsersByProfile("vip")) do


Use ipairs for arrays, pairs for tables.
Everything could have been anything else and it would have just as much meaning.

DJ Bert

Quote from: bastya_elvtars on 30 March, 2006, 00:52:37
for aux, usr in ipairs(GetUsersByProfile("vip")) do


Use ipairs for arrays, pairs for tables.

Oke, gonna try this,

Thnx bastya

SMF spam blocked by CleanTalk