Set & show redirect(s)
 

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

Set & show redirect(s)

Started by Jaakko, 10 July, 2006, 15:20:22

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jaakko

My profiles are Admin, Master, Opertaor, Vip and Reg.
Admin and Master profiles would need to see where the share redirect and full hub redirect are going to and change them (if needed).
Thank you in advance.
P.S. My full & share redirects allways go to the same address so there is no need for four commands.

Madman

-- SeeSet Redirect
-- Made by Madman, 06-07-25
-- Requested by Jaakko

CanRule = { -- Can set/set redirects
	[0] = 1, -- Masters
	[1] = 0, -- Ops
	[2] = 0, -- Vips
	[3] = 0, -- Reg
	[4] = 0, -- Custom profile
	[5] = 0, -- Custom profile 2
}

-- The cmd's, prefix not needed, support for ! + ? # scripted
SeeCmd = "seer"
SetCmd = "setr"

function ChatArrival(curUser, data)
	local data = string.sub(data, 1, -2)
	if CanRule[curUser.iProfile] == 1 then
		local s,e,cmd = string.find(data, "%b<>%s+[%!%+%?%#](%S+)")
		if cmd == SeeCmd then
			curUser:SendData(frmHub:GetHubBotName(), "Redirect address: " ..frmHub:GetRedirectAddress() .. " , Share Redirect address: " ..frmHub:GetShareRedirAddr()) return 1
		elseif cmd == SetCmd then
			local s,e,NewAddress = string.find(data, "%b<>%s+%S+%s+(%S+)")
			if NewAddress then
				frmHub:SetRedirectAddress(NewAddress)
				frmHub:SetShareRedirAddr(NewAddress)
				curUser:SendData(frmHub:GetHubBotName(), "New redirect adress set to " ..frmHub:GetRedirectAddress())
			else
				curUser:SendData(frmHub:GetHubBotName(), "Syntax: !" ..SetCmd.. " <NewAddress>")
			end
			return 1
		end
	end
end


This should do what you want. If i understood you right...
Script is set to allow only masters, but just change CanRule to allow diff. profiles.
Admin has nr 4 (most likely anyway).
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

SMF spam blocked by CleanTalk