Get profile - Help
 

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

Get profile - Help

Started by Madman, 23 September, 2004, 17:28:21

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Madman

Hi, is it posibole to get the profilename?

I use this code..
function OpConnected(User)
		if table[User.sName] then
			SendToAll(Bot, table[User.sName] )
		elseif (User.iProfile == 0) then
			SendToAll(Bot,"The Master "..User.sName.." has entered the Hub, Welcome Home.")
		elseif (User.iProfile == 1) then
			SendToAll(Bot,"The Operator "..User.sName.." has entered the Hub, Welcome Home.")
		elseif (User.iProfile == 4) then
			SendToAll(Bot,"The Moderator "..User.sName.." has entered the Hub, Welcome Home.")
		elseif (User.iProfile == 5) then
			SendToAll(Bot,"The Netfounder "..User.sName.." has entered the Hub, Welcome Home.")
		end
end

 but i want to use something like

function OpConnected(User)
		if table[User.sName] then
			SendToAll(Bot, table[User.sName] )
		else
			SendToAll(Bot,"The"..Profile.." "..User.sName.." has entered the Hub, Welcome Home.")
		end
end
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Herodes

sure u can ... from Ptokax's docs/Scripting.txt ....

Quotefrom Ptokax's docs/Scripting.txt

 - - AddProfile(profile_name, profile_data) ... adds new profile
 - - RemoveProfile(profile_name) ... removes profile
 - - GetProfileIdx(profile_name) ... gets profile index by profile name
 - - GetProfileName(profile_idx) ... gets profile name by profile index
 - - GetProfiles() ... returns profile names in a table
 - - GetUsersByProfile(profile_name) ... returns table of all users with given profile
be sure to checkout the rest of the scripting.txt because u'll find treasures in there .. :)

Madman

Yes i know... but i did not get it to work....
If i use  GetProfileName(profile_idx)
ex  GetProfileName(0)
Then All ops will get The Master bla bla...

What i want is that the scripts checks the users profile..
then depending on what profile is replace ..Profile.. with the profile name...

if user profile is operator it shows
The Operator nick is here...
but if user is master it shows
The Master nick is here..

And i only want to use this line..
SendToAll(Bot,"The"..Profile.." "..User.sName.." has entered the Hub, Welcome Home.")

Not all thoose in the first post ;)
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Typhoon

#3
function OpConnected()
local Profile =  GetProfileName(user.iProfile)
SendToAll(Bot,"The"..Profile.." "..User.sName.." has entered the Hub, Welcome Home.") 
end



Madman

#4
Thanks =)

Need some help again..

Got this table..
table = { 
			["Madman"]= "My Text",
}

But i want it to be
["Madman"]= "My Text"  "Some More Text",

What Should i write instead of ? i have Tired ..User.sName.. But that did't work...
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Typhoon

try this out , should work

table = { 
["Madman"]= "hello [nick] and welcome to the hub",
}


function OpConnected(user)
      if table[user.sName] then
         local msg = gsub(table[user.sName], "%[nick%]", user.sName) 
         SendToAll(BotName,msg)
      end
end

Typhoon?



Madman

Thanx, It worked.. =)
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Typhoon

your welcome, gonna post a standalone script including commands when i have the time to rip it from Sentinel

Typp?hoon?



Typhoon

just had some free moments so here you go

Push Here


Typhoon?



BoJlk

madman

I didn't understand the scripts fumction?

U wanted that every user enters the HUB
Everyone Connected will be notified...

*** Username entered the HUB ?

Madman

#10
Yes BoJlk..
Thats is What i Wanted, and thanks to Typhoon i got it =)
If u want i can post the script...
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

BoJlk

#11
That would be Great! 10x

doesn't it presents a problem with the RC messages
like "the oprator USER just entered, welcome home"

Madman

That's true so disable that message.. let only users and vips messages be displayed by RC
i got that mesage covered ;)
for op and higher that is...

--//Custom Log in Script Made By Madman
--//Thanks Typhoon for the help with ..Profile..
--//And Also 4 The Local msg thing

Bot = "LoginBot"

--//User enters the hub text
--//[nick] will be replaced with the users name.. 
--//["Madman"]= "The [nick] has entred", Will show
--// The Madman has entred
table = {

			["[DN]Madman"]= "The Dragon lord [nick] rided in on his breath of flame",
			["[OP]Scruffy"]= "The looser [nick] has falled in bakis",
			["[DN]Didde"]= "The man, The myth, The concept [nick] flies in to the hub",
			["-=FakeKiller=-"]= "[nick] is a killing machine, he is always busy killing people, so don't PM him",
			["Dragonmac?"]= "The Network God [nick] Has Come To Open Up The Heavens",
--//4 Madhouse
			["Madman"]= "The Dragon lord [nick] rided in on his breath of flame",
--			[""]= "[nick]",
}

--//User Disconnect Text
table2 = {

			["[DN]Madman"]= "[nick] burns down some fakers on his way out",
			["[OP]Scruffy"]= "[nick] has *gone*",
			["[DN]Didde"]= "[nick] disconnects down to flames",
			["-=FakeKiller=-"]= "[nick] has gone to the real world, to kill people",
			["Dragonmac?"]= "The Network God [nick] Has Left The Hub To Go Back To The Heavens",
--//4 Madhouse
			["Madman"]= "[nick] burns down some fakers on his way out",
--			[""]= "[nick]",
}

--//Ops Enters The Hub
function OpConnected(curUser)
      if table[curUser.sName] then
         local msg = gsub(table[curUser.sName], "%[nick%]", curUser.sName) 
         SendToAll(Bot,msg)
        --//If not in table
		else
			local Profile = GetProfileName(curUser.iProfile)
			SendToAll(Bot,"The "..Profile.." "..curUser.sName.." has entered the Hub, Welcome Home.") 
      end
end

--//Ops Leaves The Hub
function OpDisconnected(curUser)
	if table2[curUser.sName] then
		local msg = gsub(table2[curUser.sName], "%[nick%]", curUser.sName) 
         SendToAll(Bot,msg)
    --//If not in table2
	else
		local Profile = GetProfileName(curUser.iProfile)
		SendToAll(Bot,"The "..Profile.." "..curUser.sName.." has left the Hub, See you Soon.")
	end
end
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Typhoon

nice one madman :) ,, keep it up , have you looked at the above link i postet some ideas for you in that one :)

Typhoon?



Madman

#14
Yeah... But i desided to not add any options to let my op add there own texts.. they probarly change it every week.. They have trouble makeing up there minds ;p
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