[Some nonsense]Job balance Overview
PHP Code:
USE SRO_VT_SHARD
declare @huntericon varchar(1) set @huntericon = '2'--§'
declare @tradericon varchar(1) set @tradericon = '1'--$'
declare @thieficon varchar (1) set @thieficon = '3'--!'
declare @joblessicon varchar (1) set @joblessicon = '0'--?'
declare @countjobless float set @countjobless = (select count(CharID) from _CharTrijob where JobType = 0)
declare @counttrader float set @counttrader = (select count(CharID) from _CharTrijob where JobType = 1)
declare @counthunter float set @counthunter = (select count(CharID) from _CharTrijob where JobType = 2)
declare @countthief float set @countthief = (select count(CharID) from _CharTrijob where JobType = 3)
-- 1a)total chars
declare @total int set @total = (select count(CharID) from _CharTrijob)
print '* ' + cast(@total as varchar(11)) + ' total Characters.' + CHAR(13);
-- 1a) done
Declare @DynJobless varchar(99) set @DynJobless = ''
Declare @DynTrader varchar(99) set @DynTrader = ''
Declare @DynHunter varchar(99) set @DynHunter = ''
Declare @DynThief varchar(99) set @DynThief = ''
/*jobless*/
Declare @Try0 int SET @Try0 = 1
while(@Try0<=round(((@countjobless*100)/(@total)),0))
begin
set @DynJobless = @DynJobless + @joblessicon
set @Try0 = @Try0 + 1
end
if (len(@DynJobless) != cast(round(((@countjobless*100)/(@total)),0) as int))
begin raiserror ('What the fu**! Dun edit my variables ;x',11,1) end
/*trader*/
Declare @Try1 int SET @Try1 = 1
while(@Try1<=round(((@counttrader*100)/(@total)),0))
begin
set @DynTrader = @DynTrader + @tradericon
set @Try1 = @Try1 + 1
end
if (len(@DynTrader) != cast(round(((@counttrader*100)/(@total)),0) as int))
begin raiserror ('What the fu**! Dun edit my variables ;x',11,1) end
/*hunter*/
Declare @Try2 int SET @Try2 = 1
while(@Try2<=round(((@counthunter*100)/(@total)),0))
begin
set @DynHunter = @DynHunter + @huntericon
set @Try2 = @Try2 + 1
end
if (len(@DynHunter) != cast(round(((@counthunter*100)/(@total)),0) as int))
begin raiserror ('What the fu**! Dun edit my variables ;x',11,1) end
/*thief*/
Declare @Try3 int SET @Try3 = 1
while(@Try3<=round(((@countthief*100)/(@total)),0))
begin
set @DynThief = @DynThief + @thieficon
set @Try3 = @Try3 + 1
end
if (len(@DynThief) != cast(round(((@countthief*100)/(@total)),0) as int))
begin raiserror ('What the fu**! Dun edit my variables ;x',11,1) end
print 'Scale 100 "Pixels":' + CHAR(10) + @DynJobless + @DynTrader + @DynHunter + @DynThief + CHAR(13);
print
cast(round(((@countjobless*100)/(@total)),2) as varchar(11)) + '%(' + cast(@countjobless as varchar(11)) + ')'+ CHAR(9) + char(187) + CHAR(9) + 'jobless. '+ CHAR(10) +
cast(round(((@counttrader*100)/(@total)),2) as varchar(11)) + '%(' + cast(@counttrader as varchar(11)) + ')'+ CHAR(9) + char(187) + CHAR(9) + 'trader. '+ CHAR(10) +
cast(round(((@counthunter*100)/(@total)),2) as varchar(11)) + '%(' + cast(@counthunter as varchar(11)) + ')'+ CHAR(9) + char(187) + CHAR(9) + 'hunter. '+ CHAR(10) +
cast(round(((@countthief*100)/(@total)),2) as varchar(11)) + '%(' + cast(@countthief as varchar(11)) + ')'+ CHAR(9) + char(187) + CHAR(9) + 'thieves. '+ CHAR(13);
IF you ever wondered how the job balance is on your server run this one.. ;d Definitely not needed but I wanted to try some new things in sql out.
I know, the Scale is kinda noobish :)