Author Topic: Get profile - Help  (Read 3962 times)

0 Members and 1 Guest are viewing this topic.

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
Get profile - Help
« on: 23 September, 2004, 17:28:21 »
Hi, is it posibole to get the profilename?

I use this code..
Code: [Select]
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

Code: [Select]
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

PtokaX forum

Get profile - Help
« on: 23 September, 2004, 17:28:21 »

Herodes

  • Guest
(No subject)
« Reply #1 on: 23 September, 2004, 17:35:32 »
sure u can ... from Ptokax's docs/Scripting.txt ....

Quote
from 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 .. :)

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
(No subject)
« Reply #2 on: 23 September, 2004, 19:39:29 »
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

Offline Typhoon

  • Lord
  • ***
  • Posts: 397
  • Karma: +22/-3
  • PGE Developer
    • PGE Homepage
(No subject)
« Reply #3 on: 23 September, 2004, 20:21:17 »
Code: [Select]
function OpConnected()
local Profile =  GetProfileName(user.iProfile)
SendToAll(Bot,"The"..Profile.." "..User.sName.." has entered the Hub, Welcome Home.")
end
« Last Edit: 23 September, 2004, 20:21:33 by Typhoon? »



Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
(No subject)
« Reply #4 on: 23 September, 2004, 20:33:04 »
Thanks =)

Need some help again..

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

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

What Should i write instead of ? i have Tired ..User.sName.. But that did't work...
« Last Edit: 23 September, 2004, 20:44:58 by madman »
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Offline Typhoon

  • Lord
  • ***
  • Posts: 397
  • Karma: +22/-3
  • PGE Developer
    • PGE Homepage
(No subject)
« Reply #5 on: 24 September, 2004, 11:07:23 »
try this out , should work

Code: [Select]

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?



Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
(No subject)
« Reply #6 on: 24 September, 2004, 18:36:51 »
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

Offline Typhoon

  • Lord
  • ***
  • Posts: 397
  • Karma: +22/-3
  • PGE Developer
    • PGE Homepage
(No subject)
« Reply #7 on: 24 September, 2004, 19:21:52 »
your welcome, gonna post a standalone script including commands when i have the time to rip it from Sentinel

Typp?hoon?



Offline Typhoon

  • Lord
  • ***
  • Posts: 397
  • Karma: +22/-3
  • PGE Developer
    • PGE Homepage
(No subject)
« Reply #8 on: 24 September, 2004, 20:04:35 »
just had some free moments so here you go

Push Here


Typhoon?



Offline BoJlk

  • Lord
  • ***
  • Posts: 335
  • Karma: +2/-0
(No subject)
« Reply #9 on: 24 September, 2004, 20:06:13 »
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 ?

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
(No subject)
« Reply #10 on: 24 September, 2004, 20:27:14 »
Yes BoJlk..
Thats is What i Wanted, and thanks to Typhoon i got it =)
If u want i can post the script...
« Last Edit: 24 September, 2004, 20:28:29 by madman »
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Offline BoJlk

  • Lord
  • ***
  • Posts: 335
  • Karma: +2/-0
(No subject)
« Reply #11 on: 24 September, 2004, 20:31:02 »
That would be Great! 10x

doesn't it presents a problem with the RC messages
like "the oprator USER just entered, welcome home"
« Last Edit: 24 September, 2004, 20:41:17 by BoJlk »

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
(No subject)
« Reply #12 on: 24 September, 2004, 21:43:44 »
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...

Code: [Select]
--//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

Offline Typhoon

  • Lord
  • ***
  • Posts: 397
  • Karma: +22/-3
  • PGE Developer
    • PGE Homepage
(No subject)
« Reply #13 on: 24 September, 2004, 23:25:34 »
nice one madman :) ,, keep it up , have you looked at the above link i postet some ideas for you in that one :)

Typhoon?



Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
(No subject)
« Reply #14 on: 25 September, 2004, 00:17:02 »
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
« Last Edit: 25 September, 2004, 00:17:54 by madman »
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

PtokaX forum

(No subject)
« Reply #14 on: 25 September, 2004, 00:17:02 »