• Print

Author Topic: Admin sounds, tools and other code chat.  (Read 95065 times)

0 Members and 1 Guest are viewing this topic.

Offline jay209015

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 934
  • Karma: 62
    • Dev-Solutions
Re: Admin sounds, tools and other code chat.
« Reply #105 on: May 18, 2008, 07:28:28 pm »
Following your advice Kyzer, I started simple.

Code: Lua
  1. Msg("////////////////////\n")
  2. Msg("//  Module:AFK    //\n")
  3. Msg("////////////////////\n")
  4. afk_time = 0
  5. function ajoin_afk(ply)
  6.         function afk()
  7.                 if ply:IsValid() then
  8.                         view_old = ply:EyeAngles( )
  9.                         ply.old_time = CurTime()
  10.                         Msg(ply.view_old.."\n")
  11.                 end
  12.         end            
  13. end
  14. hook.Add("PlayerSpawn", "Ajoin_AFK", ajoin_afk)
  15. function afk_check()
  16.         if (CurTime() >= afk_time) then
  17.                 Msg("Checking Player Status \n")
  18.                 afk_time = CurTime() + 10
  19.         end    
  20. end
  21. hook.Add("Think", "AFK_Check", afk_check)

It prints "Checking Player Status" every 10 seconds. Only problem is, it does that before it says "Module:AFK"
Code: [Select]

Checking Player Status
Lua initialized (Lua 5.1)
////////////////////
//  Module:AFK    //
////////////////////

An error only becomes a mistake when you refuse to correct it. --JFK

"And thus the downfall of the great ULX dynasty was wrought not by another dynasty, but the slow and steady deterioration of the leaders themselves, followed by the deprecation of the great knowledge they possessed." -Gmod, Chapter 28, verse 34 -- Stickly

Offline jay209015

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 934
  • Karma: 62
    • Dev-Solutions
Re: Admin sounds, tools and other code chat.
« Reply #106 on: May 18, 2008, 08:34:12 pm »
Ok, I got an idea, but couldn't get it working. Here's the code for my latest attempt at the afk module.

Code: Lua
  1. Msg("////////////////////\n")
  2. Msg("//  Module:AFK    //\n")
  3. Msg("////////////////////\n")
  4. afk_time = 0
  5. check_time = 0
  6. function afk_check()
  7.         for _,ply in pairs(player.GetAll()) do -- Creates variable ply
  8.                 if ply:IsValid() then -- Makes sure ply is a player
  9.                         if (CurTime() >= afk_time) then
  10.                                 Msg("Checking Player Status \n")
  11.                                 afk_time = CurTime() + 20 -- Waits 20 seconds before setting ply.old_view
  12.                                 ply.old_view = ply:EyeAngles() -- Set's the ply.old_view every 20 seconds
  13.                                 check_time = CurTime() + 10 -- Waits 10 seconds after setting ply.old_view before checking afk status
  14.                         end
  15.                                         if (CurTime() >= check_time) then -- True 10 seconds after ply.old_view is set
  16.                                                 Msg("Setting " ..ply:Nick().. "'s Status \n") -- Printed 10 seconds after ply.old_view is set
  17.                                                         if ply:EyeAngles() == ply.old_view then
  18.                                                                 Msg("Player " ..ply:Nick().. " Is AFK \n")
  19.                                                         else -- True if players has moved since ply.old_view was set
  20.                                                                 Msg("Player " ..ply:Nick().. " Is ACTIVE \n")
  21.                                                         end
  22.                                                 check_time = CurTime() + 20 -- Waits 20 seconds before checking again
  23.                                         end                            
  24.                 end
  25.         end
  26. end
  27. hook.Add("Think", "AFK_Check", afk_check)

==EDIT==
I made this while you were posting :D
« Last Edit: May 18, 2008, 08:53:53 pm by jay209015 »
An error only becomes a mistake when you refuse to correct it. --JFK

"And thus the downfall of the great ULX dynasty was wrought not by another dynasty, but the slow and steady deterioration of the leaders themselves, followed by the deprecation of the great knowledge they possessed." -Gmod, Chapter 28, verse 34 -- Stickly

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Admin sounds, tools and other code chat.
« Reply #107 on: May 18, 2008, 08:44:40 pm »
This is for a learning experience,
Ok. I figured.

The below is the logic you need to do. One thing you may notice is that the think hook is added inside the check setup function, not outside the check setup.
There are many other ways to check this of course, but since you want to use the think, I've used it.

Player join, afksetup
In afksetup, set variable 'old angle', attach it to player using a unique identifier. (Steamid, or uniqueid). (ply.<unique>_afk_angle)
In afksetup, create the function, UNIQUELY named, Think will use to check.
In afksetup,(not outside the setup function like you have now), add a hook Think, named the same unique identifier you used to attach to player previously for easier stopping/tracking later.
end afksetup

Player quit, afkcheckkill
In afkcheckkill, use hook remove to kill the player's previous unique named think statement.
end afkcheckkill


Now, that will indeed create a think statement for every player that joins, instead of the 'think checks all players' way you're attempting now.
I don't believe there will be any performance degradation compared to the way now, and, you won't have to worry about duplicating/repeating or clearing out old function names.

"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline jay209015

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 934
  • Karma: 62
    • Dev-Solutions
Re: Admin sounds, tools and other code chat.
« Reply #108 on: May 18, 2008, 08:50:34 pm »
Lol, While you were typing you response Jamm, I was thinking exactly what you wrote in you post :D. Here's my working code.

Code: Lua
  1. Msg("////////////////////\n")
  2. Msg("//  Module:AFK    //\n")
  3. Msg("////////////////////\n")
  4. afk_time = 0
  5. check_time = 0
  6. function afk_check()
  7.         for _,ply in pairs(player.GetAll()) do -- Creates variable ply
  8.                 if ply:IsValid() then -- Makes sure ply is a player
  9.                         if (CurTime() >= afk_time) then
  10.                                 Msg("Checking Player Status \n")
  11.                                 afk_time = CurTime() + 20 -- Waits 20 seconds before setting ply.old_view
  12.                                 ply.old_view = ply:EyeAngles() -- Set's the ply.old_view every 20 seconds
  13.                                 check_time = CurTime() + 10 -- Waits 10 seconds after setting ply.old_view before checking afk status
  14.                         end
  15.                                         if (CurTime() >= check_time) then -- True 10 seconds after ply.old_view is set
  16.                                                 Msg("Setting " ..ply:Nick().. "'s Status \n") -- Printed 10 seconds after ply.old_view is set
  17.                                                         if ply:EyeAngles() == ply.old_view then
  18.                                                                 Msg("Player " ..ply:Nick().. " Is AFK \n")
  19.                                                         else -- True if players has moved since ply.old_view was set
  20.                                                                 Msg("Player " ..ply:Nick().. " Is ACTIVE \n")
  21.                                                         end
  22.                                                 check_time = CurTime() + 20 -- Waits 20 seconds before checking again
  23.                                         end                            
  24.                 end
  25.         end
  26. end
  27. hook.Add("Think", "AFK_Check", afk_check)
« Last Edit: May 18, 2008, 08:52:10 pm by jay209015 »
An error only becomes a mistake when you refuse to correct it. --JFK

"And thus the downfall of the great ULX dynasty was wrought not by another dynasty, but the slow and steady deterioration of the leaders themselves, followed by the deprecation of the great knowledge they possessed." -Gmod, Chapter 28, verse 34 -- Stickly

Offline jay209015

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 934
  • Karma: 62
    • Dev-Solutions
Re: Admin sounds, tools and other code chat.
« Reply #109 on: May 19, 2008, 05:47:07 pm »
More Practical times + autokicker, and keypress check.

Code: Lua
  1. -- Created By: Jay209015
  2. Msg("////////////////////\n")
  3. Msg("//  Module:AFK    //\n")
  4. Msg("////////////////////\n")
  5. afk_time = 0
  6. check_time = 0
  7. function afk_check()
  8.         for _,ply in pairs(player.GetAll()) do -- Creates variable ply
  9.                 if ply:IsValid() then -- Makes sure ply is a player
  10.                         if (CurTime() >= afk_time) then
  11.                                 Msg("Checking Player Status \n")
  12.                                 afk_time = CurTime() + 60 -- Waits 20 seconds before setting ply.old_view
  13.                                 ply.old_view = ply:EyeAngles() -- Set's the ply.old_view every 20 seconds
  14.                                 check_time = CurTime() + 50 -- Waits 10 seconds after setting ply.old_view before checking afk status
  15.                         end
  16.                                         if (CurTime() >= check_time) then -- True 10 seconds after ply.old_view is set
  17.                                                 Msg("Setting " ..ply:Nick().. "'s Status \n") -- Printed 10 seconds after ply.old_view is set
  18.                                                         if ply:EyeAngles() == ply.old_view then
  19.                                                                 if !( ply.afk_status == true ) then -- If not already afk then set ply to afk.
  20.                                                                 game.ConsoleCommand("say Player " ..ply:Nick().. " Is AFK \n")
  21.                                                                 ply.afk_status = true
  22.                                                                 else
  23.                                                                         ULib.kick(ply, "You Have Been Kicked for being Idle") --If already afk kick them.
  24.                                                                 end
  25.                                                         else -- True if players has moved since ply.old_view was set
  26.                                                                 Msg("Player " ..ply:Nick().. " Is ACTIVE \n")
  27.                                                                 ply.afk_status = false
  28.                                                         end
  29.                                                 check_time = CurTime() + 60 -- Waits 60 seconds before checking again
  30.                                         end                            
  31.                 end
  32.         end
  33. end
  34. hook.Add("Think", "AFK_Check", afk_check)
  35. function afk_keycheck( ply, key)
  36.         ply.afk_status = false
  37. end
  38. hook.Add( "KeyPress", "KeyCheck", afk_keycheck )
  39.  
An error only becomes a mistake when you refuse to correct it. --JFK

"And thus the downfall of the great ULX dynasty was wrought not by another dynasty, but the slow and steady deterioration of the leaders themselves, followed by the deprecation of the great knowledge they possessed." -Gmod, Chapter 28, verse 34 -- Stickly

Offline jay209015

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 934
  • Karma: 62
    • Dev-Solutions
Re: Admin sounds, tools and other code chat.
« Reply #110 on: May 19, 2008, 07:39:07 pm »
Nvm, I'm wrong. This is only checking one players status. Not everyone.

Code: [Select]
Checking Player Status
Setting --One--'s Status
Player --One-- Is ACTIVE
Checking Player Status
Setting --One--'s Status
Player --One-- Is ACTIVE
Checking Player Status
Precache of sprites/redglow1 ambigious (no extension specified)
Setting --One--'s Status
Player --One-- Is ACTIVE
Checking Player Status
Setting --One--'s Status
Player --One-- Is ACTIVE

there was 8 people on the server. Shouldn't the for _,ply in pairs loop through all the players?
An error only becomes a mistake when you refuse to correct it. --JFK

"And thus the downfall of the great ULX dynasty was wrought not by another dynasty, but the slow and steady deterioration of the leaders themselves, followed by the deprecation of the great knowledge they possessed." -Gmod, Chapter 28, verse 34 -- Stickly

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Admin sounds, tools and other code chat.
« Reply #111 on: May 19, 2008, 07:54:54 pm »
afk_time and check_time (and possibly other time vars) aren't unique to each player. So, it gets overwritten/uses last player each loop.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline jay209015

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 934
  • Karma: 62
    • Dev-Solutions
Re: Admin sounds, tools and other code chat.
« Reply #112 on: May 19, 2008, 08:03:07 pm »
Code: Lua
  1. -- Created By: Jay209015
  2. Msg("////////////////////\n")
  3. Msg("//  Module:AFK    //\n")
  4. Msg("////////////////////\n")
  5. function afk_check()
  6.         for _,ply in pairs(player.GetAll()) do -- Creates variable ply
  7.                 if !ply.afk_time then
  8.                         ply.afk_time = 0
  9.                 end
  10.                 if !ply.check_time then
  11.                         ply.check_time = 0
  12.                 end
  13.                 if ply:IsValid() then -- Makes sure ply is a player
  14.                         if (CurTime() >= ply.afk_time) then
  15.                                 Msg("Checking Player Status \n")
  16.                                 ply.afk_time = CurTime() + 60 -- Waits 20 seconds before setting ply.old_view
  17.                                 ply.old_view = ply:EyeAngles() -- Set's the ply.old_view every 20 seconds
  18.                                 ply.check_time = CurTime() + 50 -- Waits 10 seconds after setting ply.old_view before checking afk status
  19.                         end
  20.                                         if (CurTime() >= ply.check_time) then -- True 10 seconds after ply.old_view is set
  21.                                                 Msg("Setting " ..ply:Nick().. "'s Status \n") -- Printed 10 seconds after ply.old_view is set
  22.                                                         if ply:EyeAngles() == ply.old_view then
  23.                                                                 if !( ply.afk_status ) then -- If not already afk then set ply to afk.
  24.                                                                 game.ConsoleCommand("say Player " ..ply:Nick().. " Is AFK \n")
  25.                                                                 ply.afk_status = true
  26.                                                                 else
  27.                                                                         ULib.kick(ply, "You Have Been Kicked for being Idle") --If already afk kick them.
  28.                                                                 end
  29.                                                         else -- True if players has moved since ply.old_view was set
  30.                                                                 Msg("Player " ..ply:Nick().. " Is ACTIVE \n")
  31.                                                                 ply.afk_status = false
  32.                                                         end
  33.                                                 ply.check_time = CurTime() + 60 -- Waits 60 seconds before checking again
  34.                                         end                            
  35.                 end
  36.         end
  37. end
  38. hook.Add("Think", "AFK_Check", afk_check)

Fixed, I found that out as you were posting again, this is awkward lol. Yet again I'm just learning, and you're pro :D
An error only becomes a mistake when you refuse to correct it. --JFK

"And thus the downfall of the great ULX dynasty was wrought not by another dynasty, but the slow and steady deterioration of the leaders themselves, followed by the deprecation of the great knowledge they possessed." -Gmod, Chapter 28, verse 34 -- Stickly

Offline jay209015

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 934
  • Karma: 62
    • Dev-Solutions
Re: Admin sounds, tools and other code chat.
« Reply #113 on: May 21, 2008, 12:22:43 pm »
Code: [Select]
Hook 'AFK_Check' Failed: ULib/modules/afk.lua:27: attempt to index global 'game' (a nil value)

Code: Lua
  1. -- Created By: Jay209015
  2. Msg("////////////////////\n")
  3. Msg("//  Module:AFK    //\n")
  4. Msg("////////////////////\n")
  5. function afk_check()
  6.         for _,ply in pairs(player.GetAll()) do -- Creates variable ply
  7.                 if !ply.afk_time then
  8.                         ply.afk_time = 0
  9.                 end
  10.                 if !ply.check_time then
  11.                         ply.check_time = 0
  12.                 end
  13.                 if (ply.afk_status == nil) then
  14.                         ply.afk_status = false
  15.                 end
  16.                 if ply:IsValid() then -- Makes sure ply is a player
  17.                         if (CurTime() >= ply.afk_time) then
  18.                                 Msg("Checking Player Status \n")
  19.                                 ply.afk_time = CurTime() + 60 -- Waits 20 seconds before setting ply.old_view
  20.                                 ply.old_view = ply:EyeAngles() -- Set's the ply.old_view every 20 seconds
  21.                                 ply.check_time = CurTime() + 50 -- Waits 50 seconds after setting ply.old_view before checking afk status
  22.                         end
  23.                                         if (CurTime() >= ply.check_time) then -- True 10 seconds after ply.old_view is set
  24.                                                 Msg("Setting " ..ply:Nick().. "'s Status \n") -- Printed 10 seconds after ply.old_view is set
  25.                                                         if ply:EyeAngles() == ply.old_view then
  26.                                                                 if !( ply.afk_status ) then -- If not already afk then set ply to afk.
  27.                                                                 game.ConsoleCommand("say Player " ..ply:Nick().. " Is AFK \n")
  28.                                                                 ply.afk_status = true
  29.                                                                 else
  30.                                                                         ULib.kick(ply, "Kicked for being Idle \n Please Join Again") --If already afk kick them.
  31.                                                                 end
  32.                                                         else -- True if players has moved since ply.old_view was set
  33.                                                                 if !( ply.afk_status ) then
  34.                                                                         Msg("Player " ..ply:Nick().. " Is ACTIVE \n")
  35.                                                                         ply.afk_status = false
  36.                                                                 else
  37.                                                                         Msg("Player " ..ply:Nick().. " Has Returned \n")
  38.                                                                         game.ConsoleCommand("say Player " ..ply:Nick().. " Has Returned \n")
  39.                                                                         ply.afk_status = false
  40.                                                                 end
  41.                                                         end
  42.                                                 ply.check_time = CurTime() + 60 -- Waits 60 seconds before checking again
  43.                                         end                            
  44.                 end
  45.         end
  46. end
  47. hook.Add("Think", "AFK_Check", afk_check)
  48. function afk_keycheck(ply, key)
  49.         if ply.afk_status then
  50.                 game.ConsoleCommand("say Player " ..ply:Nick().. " Has Returned \n")
  51.                 ply.afk_status = false
  52.         end
  53. end
  54. hook.Add( "KeyPress", "KeyCheck", afk_keycheck )
  55. function afk_set(ply)
  56.         ply.afk_status = false
  57. end
  58. hook.Add( "PlayerInitialSpawn", "SetAfk", afk_set )
An error only becomes a mistake when you refuse to correct it. --JFK

"And thus the downfall of the great ULX dynasty was wrought not by another dynasty, but the slow and steady deterioration of the leaders themselves, followed by the deprecation of the great knowledge they possessed." -Gmod, Chapter 28, verse 34 -- Stickly

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2727
  • Karma: 430
    • |G4P| Gman4President
Re: Admin sounds, tools and other code chat.
« Reply #114 on: May 21, 2008, 12:56:55 pm »
Im glad you are taking this up as a learning experience... however I would strongly recommend NOT using a think hook for the afk check function. Can you imagine the server performing multiple checks on multiple players 60+ times a second?

If you are only using seconds as in.. CurTime() and whatnot.. I would recommend you use a timer. Set the time to 1 second.

Even a 1 second timer is WAY less intensive than a think.


^^Just my 2 cents =)

Offline jay209015

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 934
  • Karma: 62
    • Dev-Solutions
Re: Admin sounds, tools and other code chat.
« Reply #115 on: May 21, 2008, 01:23:54 pm »
I'll just use your :D, I got what I needed out of this.
An error only becomes a mistake when you refuse to correct it. --JFK

"And thus the downfall of the great ULX dynasty was wrought not by another dynasty, but the slow and steady deterioration of the leaders themselves, followed by the deprecation of the great knowledge they possessed." -Gmod, Chapter 28, verse 34 -- Stickly

Offline jay209015

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 934
  • Karma: 62
    • Dev-Solutions
Re: Admin sounds, tools and other code chat.
« Reply #116 on: May 22, 2008, 05:25:44 pm »
I'm making an antispam, but I want to add an ability to detect a whitelist of toolmodes, and at the moment, it's not setting XDelay ever.

Code: Lua
  1. dlist = { "crane_frame.mdl", "models/props_phx/ball.mdl", "models/props_phx/oildrum001_explosive.mdl", "models/props_phx/mk-82.mdl", "models/props_phx/torpedo.mdl", "models/props_phx/ww2bomb.mdl", "models/props_phx/misc/flakshell_big.mdl", "models/props_junk/gascan001a.mdl", "models/props_junk/propane_tank001a.mdl", "models/props_c17/oildrum001_explosive.mdl", "models/props_phx/huge/tower.mdl", "models/props_phx/huge/evildisc_corp.mdl", "models/props_phx/playfield.mdl", "models/props_c17/utilitypole01d.mdl" }
  2. Delay = 0.3
  3. XDelay = 1
  4. function setup_propspawn(ply)
  5.         ply.denied = false
  6.         ply.d_time = 0
  7.         Msg(ply.d_time.. " \n")
  8. end
  9. hook.Add( "PlayerInitialSpawn", "Setup_PropSpawn", setup_propspawn );
  10. function propspawn(ply, mdl)
  11.         if CurTime() < ply.d_time then
  12.                 wait_time = ply.d_time - math.Round(CurTime())
  13.                 ply:PrintMessage(HUD_PRINTTALK, "You must wait " ..wait_time.. " second(s) before spawning another prop")
  14.                 return false
  15.         else
  16.                 for _,v in pairs(dlist) do
  17.                         if string.find( mdl, v) then
  18.                                 ply.d_time = (math.Round(CurTime()) + XDelay)
  19.                         else
  20.                                 ply.d_time = (math.Round(CurTime()) + Delay)
  21.                         end
  22.                 end
  23.                 Msg(ply.d_time.. " \n")
  24.                 return true
  25.         end
  26. end
  27. hook.Add( "PlayerSpawnProp", "PropSpawn", propspawn )
An error only becomes a mistake when you refuse to correct it. --JFK

"And thus the downfall of the great ULX dynasty was wrought not by another dynasty, but the slow and steady deterioration of the leaders themselves, followed by the deprecation of the great knowledge they possessed." -Gmod, Chapter 28, verse 34 -- Stickly

Offline jay209015

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 934
  • Karma: 62
    • Dev-Solutions
Re: Admin sounds, tools and other code chat.
« Reply #117 on: May 22, 2008, 05:50:59 pm »
This works, but not if I add more then one item to dlist.
Code: Lua
  1. dlist = { "crane_frame.mdl" }
  2. Delay = 0.3
  3. XDelay = 1
  4. function setup_propspawn(ply)
  5.         ply.denied = false
  6.         ply.d_time = 0
  7.         Msg(ply.d_time.. " \n")
  8. end
  9. hook.Add( "PlayerInitialSpawn", "Setup_PropSpawn", setup_propspawn );
  10. function propspawn(ply, mdl)
  11.         for k, v in pairs( dlist ) do
  12.                 if string.find( mdl, v, 1, true ) then
  13.                         ply.black_list = true
  14.                         Msg("True \n")
  15.                 else
  16.                         ply.black_list = false
  17.                         Msg("False \n")
  18.                 end
  19.         end
  20.                 if CurTime() < ply.d_time then
  21.                         ply:PrintMessage(HUD_PRINTTALK, "You must wait " ..wait_time.. " second(s) before spawning another prop")
  22.                         return false
  23.                 else
  24.                         if (ply.black_list == true) then
  25.                                 ply.d_time = math.Round(CurTime()) + XDelay
  26.                                 wait_time = XDelay
  27.                                 return true
  28.                         else
  29.                                 ply.d_time = math.Round(CurTime()) + Delay
  30.                                 wait_time = Delay
  31.                                 return true
  32.                         end                    
  33.                 end
  34. end
  35. hook.Add( "PlayerSpawnProp", "PropSpawn", propspawn )
An error only becomes a mistake when you refuse to correct it. --JFK

"And thus the downfall of the great ULX dynasty was wrought not by another dynasty, but the slow and steady deterioration of the leaders themselves, followed by the deprecation of the great knowledge they possessed." -Gmod, Chapter 28, verse 34 -- Stickly

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Admin sounds, tools and other code chat.
« Reply #118 on: May 22, 2008, 06:26:46 pm »
A wise coder once told me, never return a non-nil value unless your calling a function expecting a non-nil value.
IE, don't use 'return true', just use 'return'. Return false should work fine though.
As for your only working once with more than one dlist item, no idea.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline jay209015

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 934
  • Karma: 62
    • Dev-Solutions
Re: Admin sounds, tools and other code chat.
« Reply #119 on: May 22, 2008, 06:27:35 pm »
Ty, I will use your advice.
An error only becomes a mistake when you refuse to correct it. --JFK

"And thus the downfall of the great ULX dynasty was wrought not by another dynasty, but the slow and steady deterioration of the leaders themselves, followed by the deprecation of the great knowledge they possessed." -Gmod, Chapter 28, verse 34 -- Stickly

  • Print