add profile-name to description
 

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

add profile-name to description

Started by Killahpriest, 28 July, 2004, 23:36:40

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Killahpriest

i just started a hub and i'm slowly getting better in scripting my own bots/commands

but the next thing i want to do is that the users get their profile names (master/vip/op/reg/unreg) into their description

it should look like : [Operator]Description

can it be done by changing the Decription directly? (i wonder if i could change the nick by changing the sName to delete some [bla]-stuff???)

or do i have to do it by

SendToAll($MyInfoString .... (or whatever the command was)

i managed to get the profile name to the description when the user logged in but it vanished just seconds later :(

thx for help in advance

NightLitch

make a timer that sends out the MyInfo strings every say 30sec I don't now what is good or bad for the hub depending on how big it is, cause of how much resources it takes...

/NL
//NL

??????Hawk??????

#2
try this m8

--====COPY FROM THIS LINE=====


--Description Tag by ??????Hawk?????? 05-07-2004

--===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 = "{Admin}"   	--\\ Tag

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

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 = strfind(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 = strfind(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 = strfind(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 = strfind(userToShow.sMyInfoString, "$MyINFO $ALL (%S+)%s+([^$]*)$ $([^$]*)$([^$]*)$([^$]+)")
				SendToAll( "$MyINFO $ALL "..name.." "..regTagInDescription.." "..desc.."$ $"..speed.."$"..email.."$"..share.."$")
			end
		end
	end
end



--====FINISH COPYING HERE=====




Or You could just click on my description and d/l   esthetic bot  ........    its got that feature built in  and a load more  :-)

NotRabidWombat

That's pretty silly.

Just catch the MyINFO and GetINFO in DataArrival and override them. Doesn't waste bandwidth.

-NotRabidWombat


I like childish behavior. Maybe this post will be deleted next.

??????Hawk??????

QuoteThat's pretty silly.


 Ohh Sorry i didnt realise

ill stick to compiling scripts from now on then...

and only give the code to ppl that are willing to be more diplomatic and less insulting in their help....


Any more help required on this script pls ask NotRabidWombat..............

NotRabidWombat

QuoteOriginally posted by ?˜”??•Hawk•??”˜?
QuoteThat's pretty silly.


 Ohh Sorry i didnt realise

ill stick to compiling scripts from now on then...

and only give the code to ppl that are willing to be more diplomatic and less insulting in their help....


Any more help required on this script pls ask NotRabidWombat..............
So it's my fault you didn't choose an effective manor of producing the desired results. And to punish me, and everyone else, you'll disallow everyone else from commenting on your code, inhibiting yourself from growing as a developer.

Good strategy.

I'll be back in a few with the code, cause some people are too stuck up to take advice.

-NotRabidWombat


I like childish behavior. Maybe this post will be deleted next.

??????Hawk??????

#6
hi  NotRabidWombat

Constructive criticism  i can cope with  But  insulting someone elses work with comments like that is just a Blatent Lack of respect for other users.

we are all at different levels in here and not all code posted is going to be the best solution.

but you seem to Expect others to be at your level of coding..

well here's an eye opener for you .......   Im still learning  and will be as long as im alive..

take a step back and look at what your posting before you hit the button and consider "  Is It constructive or insulting "

if the latter then dont hit the submit button......

i see you managed yet another insult in your second post ...  pls read above before you go for a 3rd post ..

Snooze

To complete the help for Killahpriest and to show the rest of us how you would have solved the problem, please submit a working example NotRabidWombat ;)

Thanks,

Snooze

Killahpriest

@NotRabidWombat

i've tried it like this but then the users will have to write something in mainchat for getting the tag ???

(i used parts of this script: here )

i tried but i had to write something in mainchat before the tag was added  ?(

IceCoder

#9
haha nice hawk

plop

i had a discussion about this with wombat yesterday and we found out a couple things.
doing it without a timer doesn't work, the faked myinfo is send before the real 1.
doing it with a timer is like wombat said a waste of bandwith as it keeps sending the myinfo's even when not needed.
a better way is 2 do it like Killahpriest tryed, delay the sending of the faked tag.
but it needs some more things 2 make it work more efficiently.
only send the myinfo's which are needed, incase of a login/getnicklist you gotta send the full list.
but incase of a single myinfo only send that single 1.
because of the fact that (for now) the myinfo can't be blocked this kind of scripts will always waste bandwidth.
but @ least it can be minimized.
wombat is working on something which can change this fact, but i'm not yet gone tell anything about that (gone leave that 2 him).
i'm also not gone make a script like this because of the waste of bandwidth and i can't see then need for these kind of things.
and finaly running a script like this increases the damage myinfo flooders can do 2 a hub.
because the real myinfo can't be blocked, you help the flooder 2 double the impact (every myinfo is send out 2x).

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Killahpriest

i use this script for a small private hub
(i have accepted to set up a hub for the city i live in)
furthermore i don't think i will realy use it...
i want to learn scripting by realising some things and this is something i want to do so i understand the scripts better :)

additional question: is there a list of variables?

i mean the .sName .iProfile etc.

Herodes

You need to look into the docs folder ... it is found in the folder where PtokaX.exe is. When you find it look for the Scripting.txt ...

It is very nicely laid out in there ...

You'll find using the Search on this forum for "Scripting.txt" very usefull too there are many advice around... ;)

Killahpriest

thx guys... the scripts work :]  (i think there will only be 30 users on my hub or so in the beginning so it won't be a problem)

Millsy

#14
can u make it so it only for reg and unreg please
MoviePirates.no-ip.com    -   Part Of The BBI Network

CuT-KiLLeR

Quote--ProfiledDescription 1.0
--
--by Mutor
--
--Based on Description Tag by ??????Hawk?????? 05-07-2004
--Great Idea Hawk ...thx
--
--User Profiles saved to table at connect and to file at restart
--Users string is broadcast to all after brief delay
--Refresh of user list returns only to user requesting list
--Dropped timer, exists only to delay MyINFO
--A work in progress, but a decent start
--Post your comments
--


can you make a Tag Desc. =  [HuBOwner]  ?

this is a good Script !!!....

thank you...


( my english ist small... sory )

FrAcTi0n

ok, so a few questions.... is it possible to show that description only for specified users?
ie only for ops....
maybe that should help with that traffic....

and question 2, is it possible, if that what i write before is not possible, to rename the tag only for unregistered, vip, and ops.... maybe that would save some traffic too... if there is 95 percent of registered user.)

hope that it is possible and someone will try it
thx.)

SMF spam blocked by CleanTalk