The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
List of skills (highest to lowest)
Author Message
Soulless
Super Moderator
****

Posts: 335
Likes Given: 29
Likes Received: 49 in 27 posts
Joined: Jun 2012
Reputation: 12

Ye Olde Sphere

Post: #1
List of skills (highest to lowest)
Can anyone see a better way of creating this script? it def will lag the player if they did it often. I just got it all working, i think im just having a dumb day, but if anyone can do this better please feel free to chime in.

Code:
[function rankskill] //compare 1 skill to the other 48 and return ranking
for 48
if (<<serv.skill.<argn>.key>> == <<serv.skill.<local._for>.key>>) && (<argn>!=<local._for>)
local.sameas += 1
endif
if (<<serv.skill.<argn>.key>> > <<serv.skill.<local._for>.key>>)
local.betterthan += 1
endif
endfor
return <eval (48-<local.betterthan>)>


[function compareskills]
serv.log <local.rank>
for 48    //set skill ranks
if !(<local.skill<rankskill <local._for>>>)
local.skill<rankskill <local._for>>=<serv.skill.<local._for>.key>
else


local.x=<rankskill <local._for>>
local.messedup=1
while <local.messedup>
if (<local.skill<eval <local.x>>>)
local.x -= 1
else
local.skill<eval <local.x>>=<serv.skill.<local._for>.key>
local.messedup=

endif
endwhile

endif
endfor


for 48     //test in console to see if it lists right
serv.log <local.skill<eval <local._for>>>
endfor
(This post was last modified: 07-23-2012 01:05 AM by Soulless.)
07-22-2012 09:34 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Soulless
Super Moderator
****

Posts: 335
Likes Given: 29
Likes Received: 49 in 27 posts
Joined: Jun 2012
Reputation: 12

Ye Olde Sphere

Post: #2
RE: List of skills (highest to lowest)
EDIT: i removed this reply because its no longer necessary since the error has been resolved. But if anyone can please help optimize the above code i would really appreciate it.

thanks.
(This post was last modified: 07-23-2012 01:07 AM by Soulless.)
07-22-2012 11:10 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Shaklaban
Master
**

Posts: 378
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 8

DOT

Post: #3
RE: List of skills (highest to lowest)
you can use skillbest function:

PHP Code:
[dialog sb_test]
100,100
resizepic 0 0 
<def.menu_border200 350
gumppictiled 10 10 180 330 2624
checkertrans 10 10 180 330

local
.20
local
.20
for 0 9
    
if <src.<skillbest.<local._for>>> > 0
        dtext 
<local.x> <local.y1152 <src.skillbest.<local._for>>
        
local.+= 20
    
endif 
endfor 
(This post was last modified: 07-23-2012 01:16 AM by Shaklaban.)
07-23-2012 01:15 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Soulless
Super Moderator
****

Posts: 335
Likes Given: 29
Likes Received: 49 in 27 posts
Joined: Jun 2012
Reputation: 12

Ye Olde Sphere

Post: #4
RE: List of skills (highest to lowest)
Thanks Shaklaban.

Even though i feel so stupid for writing such a ridiculous function to sort the skills. it will come in handy someday with something else.

i very much appreciate your hepl Smile
07-23-2012 02:26 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Shaklaban
Master
**

Posts: 378
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 8

DOT

Post: #5
RE: List of skills (highest to lowest)
no problem, thanks to sugarcube we have this function.
07-23-2012 05:44 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Anarch Cassius
Master
**

Posts: 273
Likes Given: 19
Likes Received: 10 in 9 posts
Joined: Mar 2012
Reputation: 2



Post: #6
RE: List of skills (highest to lowest)
Yeah, that function just helped a bunch with my quasi-champ system.

Current Projects: Necromancy SCP overhaul. Custom Faction AI/System. Imbuing.
07-23-2012 06:53 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)