User Commands for PtokaX 0.3.4.0 and newer
 

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

User Commands for PtokaX 0.3.4.0 and newer

Started by PPK, 31 May, 2006, 00:55:39

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PPK

This is User Commands script contains menus for all PtokaX inbuild commands. Is done to show all comands in proper context (hub tab menu, user menu, search menu or filelist menu) and to be easy for next PtokaX release to compress them (in test, PtokaX is able compress 2000 bytes long user commands to only 500 bytes :o8)
-- UserCommands for PtokaX 0.3.4.0 and newer by PPK

function NewUserConnected(curUser)
	if curUser.bUserCommand then
		if curUser.iProfile == -1 then
			local usrcmds = "$UserCommand 255 15|$UserCommand 0 3|$UserCommand 1 3 Help$<%[mynick]> !help&#124;|$UserCommand 1 3 Show my IP$<%[mynick]> !myip&#124;"
			curUser:SendData(usrcmds)
		else
			SendUserCommands(curUser)
		end
	end
end

function OpConnected(curUser)
	if curUser.bUserCommand then
		SendUserCommands(curUser)
	end
end

function SendUserCommands(curUser)
	permissions = GetProfilePermissions(curUser.iProfile)
	local usrcmds = "$UserCommand 255 15|$UserCommand 0 15|$UserCommand 1 3 Help$<%[mynick]> !help&#124;|$UserCommand 1 3 Show my IP$<%[mynick]> !myip&#124;|$UserCommand 1 1 Set password$<%[mynick]> !passwd %[line:Enter new password]&#124;"
	if permissions.bGetInfo then
		usrcmds = usrcmds.."|$UserCommand 2 14 Show user info$<%[mynick]> !getinfo %[nick]&#124;"
	end
	if permissions.bGag then
		usrcmds = usrcmds.."|$UserCommand 2 2 Gag menu\\Gag user$<%[mynick]> !gag %[nick]&#124;"
		usrcmds = usrcmds.."|$UserCommand 2 2 Gag menu\\Ungag user$<%[mynick]> !ungag %[nick]&#124;"
	end
	if permissions.bBan then
		usrcmds = usrcmds.."|$UserCommand 2 14 Ban menu\\Ban user$<%[mynick]> !ban %[nick] %[line:Enter a reason]&#124;"
		usrcmds = usrcmds.."|$UserCommand 2 14 Ban menu\\Ban user nick$<%[mynick]> !nickban %[nick] %[line:Enter a reason]&#124;"
		usrcmds = usrcmds.."|$UserCommand 2 3 Ban menu\\Ban IP$<%[mynick]> !banip %[line:Enter an IP to ban] %[line:Enter a reason]&#124;"
		usrcmds = usrcmds.."|$UserCommand 2 14 Ban menu\\Full ban user$<%[mynick]> !fullban %[nick] %[line:Enter a reason]&#124;"
		usrcmds = usrcmds.."|$UserCommand 2 3 Ban menu\\Full ban IP$<%[mynick]> !fullbanip %[line:Enter an IP to ban] %[line:Enter a reason]&#124;"
	end
	if permissions.bTempBan then
		usrcmds = usrcmds.."|$UserCommand 2 14 Ban menu\\Temp ban user$<%[mynick]> !tempban %[nick] %[line:Enter a time] %[line:Enter a reason]&#124;"
		usrcmds = usrcmds.."|$UserCommand 2 14 Ban menu\\Temp ban user nick$<%[mynick]> !nicktempban %[nick] %[line:Enter a time] %[line:Enter a reason]&#124;"
		usrcmds = usrcmds.."|$UserCommand 2 3 Ban menu\\Temp ban IP$<%[mynick]> !tempbanip %[line:Enter an IP to ban] %[line:Enter a time] %[line:Enter a reason]&#124;"
		usrcmds = usrcmds.."|$UserCommand 2 14 Ban menu\\Full temp ban user$<%[mynick]> !fulltempban %[nick] %[line:Enter a time] %[line:Enter a reason]&#124;"
		usrcmds = usrcmds.."|$UserCommand 2 3 Ban menu\\Full temp ban IP$<%[mynick]> !fulltempbanip %[line:Enter an IP to ban] %[line:Enter a time] %[line:Enter a reason]&#124;"
	end
	if permissions.bUnban then
		usrcmds = usrcmds.."|$UserCommand 1 3 Ban menu\\Unban$<%[mynick]> !unban %[line:Enter IP or Nick to unban]&#124;"
		usrcmds = usrcmds.."|$UserCommand 1 3 Ban menu\\Unban perm ban$<%[mynick]> !permunban %[line:Enter IP or Nick to unban]&#124;"
	end
	if permissions.bTempUnban then
		usrcmds = usrcmds.."|$UserCommand 1 3 Ban menu\\Unban temp ban$<%[mynick]> !tempunban %[line:Enter IP or Nick to unban]&#124;"
	end
	if permissions.bGetBans then
		usrcmds = usrcmds.."|$UserCommand 1 1 Ban menu\\Check if is nick banned$<%[mynick]> !checknickban %[line:Enter nick to check]&#124;"
		usrcmds = usrcmds.."|$UserCommand 1 1 Ban menu\\Check if is IP banned$<%[mynick]> !checkipban %[line:Enter IP to check]&#124;"
		usrcmds = usrcmds.."|$UserCommand 1 1 Ban menu\\Show ban list$<%[mynick]> !getbans&#124;"
		usrcmds = usrcmds.."|$UserCommand 1 1 Ban menu\\Show perm bans list$<%[mynick]> !getpermbans&#124;"
		usrcmds = usrcmds.."|$UserCommand 1 1 Ban menu\\Show temp bans list$<%[mynick]> !gettempbans&#124;"
	end
	if permissions.bClrPermBan then
		usrcmds = usrcmds.."|$UserCommand 1 1 Ban menu\\Clear permanent bans$<%[mynick]> !clrpermbans&#124;"
	end
	if permissions.bClrTempBan then
		usrcmds = usrcmds.."|$UserCommand 1 1 Ban menu\\Clear temporary bans$<%[mynick]> !clrtempbans&#124;"
	end
	if permissions.bRangeBan then
		usrcmds = usrcmds.."|$UserCommand 1 1 Range ban menu\\Range ban$<%[mynick]> !rangeban %[line:Enter from IP] %[line:Enter to IP] %[line:Enter a reason]&#124;"
		usrcmds = usrcmds.."|$UserCommand 1 1 Range ban menu\\Full range ban$<%[mynick]> !fullrangeban %[line:Enter from IP] %[line:Enter to IP] %[line:Enter a reason]&#124;"
	end
	if permissions.bRangeUnban then
		usrcmds = usrcmds.."|$UserCommand 1 1 Range ban menu\\Unban range ban$<%[mynick]> !rangeunban %[line:Enter from IP] %[line:Enter to IP]&#124;"
		usrcmds = usrcmds.."|$UserCommand 1 1 Range ban menu\\Unban permanent range ban$<%[mynick]> !rangepermunban %[line:Enter from IP] %[line:Enter to IP]&#124;"
	end
	if permissions.bRangeTempBan then
		usrcmds = usrcmds.."|$UserCommand 1 1 Range ban menu\\Range temp ban$<%[mynick]> !rangetempban %[line:Enter from IP] %[line:Enter to IP] %[line:Enter a time] %[line:Enter a reason]&#124;"
		usrcmds = usrcmds.."|$UserCommand 1 1 Range ban menu\\Full range temp ban$<%[mynick]> !fullrangetempban %[line:Enter from IP] %[line:Enter to IP] %[line:Enter a time] %[line:Enter a reason]&#124;"
	end
	if permissions.bRangeTempUnban then
		usrcmds = usrcmds.."|$UserCommand 1 1 Range ban menu\\Unban temp range ban$<%[mynick]> !rangetempunban %[line:Enter from IP] %[line:Enter to IP]&#124;"
	end
	if permissions.bGetRangeBans then
		usrcmds = usrcmds.."|$UserCommand 1 1 Range ban menu\\Check if is range banned$<%[mynick]> !checkrangeban %[line:Enter from IP] %[line:Enter to IP]&#124;"
		usrcmds = usrcmds.."|$UserCommand 1 1 Range ban menu\\Show range bans list$<%[mynick]> !getrangebans&#124;"
		usrcmds = usrcmds.."|$UserCommand 1 1 Range ban menu\\Show range perm bans list$<%[mynick]> !getrangepermbans&#124;"
		usrcmds = usrcmds.."|$UserCommand 1 1 Range ban menu\\Show range temp bans list$<%[mynick]> !getrangetempbans&#124;"
	end
	if permissions.bClearRangePermBans then
		usrcmds = usrcmds.."|$UserCommand 1 1 Range ban menu\\Clear permanent range bans$<%[mynick]> !clrrangepermbans&#124;"
	end
	if permissions.bClearRangeTempBans then
		usrcmds = usrcmds.."|$UserCommand 1 1 Range ban menu\\Clear temporary range bans$<%[mynick]> !clrtempbans&#124;"
	end
	if permissions.bDrop then
		usrcmds = usrcmds.."|$UserCommand 2 14 Drop user$<%[mynick]> !drop %[nick]&#124;"
	end
	if permissions.bTopic then
		usrcmds = usrcmds.."|$UserCommand 1 1 Change topic$<%[mynick]> !topic %[line:Enter new topic]&#124;"
	end
	if permissions.bMassMsg then
		usrcmds = usrcmds.."|$UserCommand 1 1 Send mass message$<%[mynick]> !massmsg %[line:Enter message to send]&#124;"
		usrcmds = usrcmds.."|$UserCommand 1 1 Send mass message to OPs$<%[mynick]> !opmassmsg %[line:Enter message to send]&#124;"
	end
	if permissions.bRefreshTxt then
		usrcmds = usrcmds.."|$UserCommand 1 1 Reload text files$<%[mynick]> !reloadtxt&#124;"
	end
	if permissions.bAddRegUser then
		usrcmds = usrcmds.."|$UserCommand 1 1 Registered users menu\\Add registered user$<%[mynick]> !addreguser %[line:Enter nick] %[line:Enter password] %[line:Enter profile name]&#124;"
		usrcmds = usrcmds.."|$UserCommand 1 2 Add to registered users$<%[mynick]> !addreguser %[nick] %[line:Enter password] %[line:Enter profile name]&#124;"
	end
	if permissions.bDelRegUser then
		usrcmds = usrcmds.."|$UserCommand 1 1 Registered users menu\\Delete registered user$<%[mynick]> !delreguser %[line:Enter nick]&#124;"
	end
	if permissions.bTempOP then
		usrcmds = usrcmds.."|$UserCommand 1 2 Give user temporary OP$<%[mynick]> !op %[nick]&#124;"
	end
	if permissions.bRestartScripts then
		usrcmds = usrcmds.."|$UserCommand 1 1 Scripts menu\\Start script$<%[mynick]> !startscript %[line:Enter script name]&#124;"
		usrcmds = usrcmds.."|$UserCommand 1 1 Scripts menu\\Restart script$<%[mynick]> !restartscript %[line:Enter script name]&#124;"
		usrcmds = usrcmds.."|$UserCommand 1 1 Scripts menu\\Restart scripts$<%[mynick]> !restartscripts&#124;"
		usrcmds = usrcmds.."|$UserCommand 1 1 Scripts menu\\Stop script$<%[mynick]> !stopscript %[line:Enter script name]&#124;"
		usrcmds = usrcmds.."|$UserCommand 1 1 Scripts menu\\Get scripts list$<%[mynick]> !getscripts&#124;"
	end
	if permissions.bRestartHub then
		usrcmds = usrcmds.."|$UserCommand 1 1 Restart hub$<%[mynick]> !restart&#124;"
	end

	curUser:SendData(usrcmds)
end


Or download it here. If you find any bugs please report them here.
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall


CrazyGuy

Hey PPK,

Not sure if it's a bug or not, but when using these rightclick commands, all rightclick commands from my other scripts disappeared? :'(
When I moved your rightclicks to the top of the scripts lists, the others came back? ;D

Any clue on why ?


GeceBekcisi

$UserCommand 255 <context> |


Will erase all commands that the hub has sent previously. This is for hubs/scripts that allow for updates while running. The erase all is intentional, keeping it simple. Note that contexts must still be used, and that erasing will remove all commands that match any of those ORed contexts (i.e. 7 will remove commands previously sent with any context of 1 through 7) but only from that context


Source
Do you need an advanced user handling script? Download UserBekcisi today (Latest Edit)
Features: User + ISP + GeoIP database, user info + share checking and many more...

Helios

 this work fine

it is not complete more commands needed type setminslot -setmaxslot- setminshare - setmaxshare - setminhub and setmaxhub


tnx

Psycho_Chihuahua

Quote from: Helios on 20 June, 2006, 17:17:53
this work fine

it is not complete more commands needed type setminslot -setmaxslot- setminshare - setmaxshare - setminhub and setmaxhub


tnx

feel free to update and post it then  ;)
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Thor

Those commands are not inbuild commands. Btw here is a small script to add to the rightclickmenu all the scripts which are in the scripts folder:
-- LUA scripts in rightclick menu
-- All LUA-script, which is on the scripts folder,
-- will send to the operator, when connects.
-- Based on vh_lua_manager.lua by Ro
-- Made by Hungarista
-- 2006.06.19

function OpConnected(curUser)
	local permission = GetProfilePermissions(curUser.iProfile)
	if permission.bRestartScripts then
		os.execute("dir /B /ON "..string.gsub(frmHub:GetPtokaXLocation(),"/","\\").."scripts\\ > lualist.txt")
		curUser:SendData("$UserCommand 1 3 "..frmHub:GetHubName().."\\Scripts\\Get scripts$<%[mynick]> !getscripts&#124;|")
		curUser:SendData("$UserCommand 1 3 "..frmHub:GetHubName().."\\Scripts\\Restart scripts$<%[mynick]> !restartscripts&#124;|")
		curUser:SendData("$UserCommand 0 3|")
		local command = "!startscript"
		local stat = "start"
		SendUsercommands(curUser,command,stat)
		curUser:SendData("$UserCommand 0 3|")
		local command = "!stopscript"
		local stat = "stop"
		SendUsercommands(curUser,command,stat)
	end
end

function SendUsercommands(curUser,command,stat)
	local file = io.open(string.gsub(frmHub:GetPtokaXLocation(),"/","\\").."scripts\\lualist.txt", "r")
	if (file) then
		local line = file:read()
		while line do
			if (string.sub(line, (string.len(line)-2), string.len(line)) == "lua") then
				curUser:SendData("$UserCommand 1 3 "..frmHub:GetHubName().."\\Scripts\\"..stat.."\\"..line.." "..stat.."$<%[mynick]> "..command.." "..line.."&#124;|")
			end
		line = file:read()
		end
		file:close()
	end
end

Helios

tnx for the help

a complete script is by pothead called commands it is posted here

the script report me this error : Syntax F:\recupero\Ptokax\Ptokax\scripts\commands.lua:442: bad argument #1 to 'pairs' (table expected, got function)

any1 correct this

tnx 1000

SMF spam blocked by CleanTalk