Pirate The World - Online Adventure Game

Pirate The World Game Forums
It is currently Mon Sep 20, 2021 10:32 pm

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Cashout adder
PostPosted: Mon May 26, 2008 10:47 pm 
Offline
User avatar

Joined: Fri Feb 24, 2006 1:38 am
Posts: 726
Location: New Zealand
Not sure if anyone will find this script useful, but it adds up cashout threads for you and gives you the totals, averages, etc:

<html>
<head><title>Cashout Adder</title></head>
<body>
<script language="vbs">
Sub GetValues
Dim HoldText, SplitText, SplitTotal, SplitCount, DataHold, DataSplit, DataCount, DataValues, DataTitles, DataTotal, NamesTotal

DataTitles = Split("Names in list,Number of people,SD total,GD total,Average number of SD,Average number of GD", ",")
DataTotal = UBound(DataTitles)
ReDim DataValues(DataTotal)
HoldText = GetText.Value
SplitText = Split(HoldText, vbCrLf)
SplitTotal = UBound(SplitText)
If SplitTotal > 0 Then
For SplitCount = 0 To SplitTotal
DataHold = Trim(SplitText(SplitCount))
If DataHold = "" Then Exit For
DataSplit = Split(DataHold, "-")
DataValues(0) = DataValues(0) & Trim(DataSplit(0)) & ", "
DataSplit = Split(Mid(DataHold, InStr(DataHold, "-") + 1, Len(DataHold)), ",")
For DataCount = 0 To UBound(DataSplit)
If InStr(DataSplit(DataCount), "SD") <> 0 Then DataValues(2) = DataValues(2) + CByte(left(DataSplit(DataCount),InStrRev(DataSplit(DataCount), " ")))
If InStr(DataSplit(DataCount), "GD") <> 0 Then DataValues(3) = DataValues(3) + CByte(left(DataSplit(DataCount),InStrRev(DataSplit(DataCount), " ")))
Next
Next
NamesTotal = UBound(Split(DataValues(0)))
DataValues(4) = Round(DataValues(2) / NamesTotal, 2)
DataValues(5) = Round(DataValues(3) / NamesTotal, 2)
DataValues(0) = Left(DataValues(0), Len(DataValues(0)) - 2)
DataValues(1) = NamesTotal
ShowValues.innerHTML=""
For DataCount = 0 To DataTotal
ShowValues.innerHTML = ShowValues.innerHTML & "<p>" & DataTitles(DataCount) & ": " & DataValues(DataCount) & "</p>"
Next
ShowValues.innerHTML = ShowValues.innerHTML & "<p>Data excludes piracy ranks, please add 120 to the total GD to find the number of GD given in total.</p>"
GetText.Value = "Ready for more data."
Else
GetText.Value = "Please retry."
MsgBox "Data invaild", vbCritical
End If
End Sub
</script>
First paste the cash out values in the box below:
<p><textarea rows="1" name="GetText" cols="43"></textarea></p>
<p>Then click button to get results:</p>
<p><input type="button" value="Go" name="DoWork" onclick="GetValues"></p>
<hr>
<form id="ShowValues"></form>
</body>
</html>

To use it just copy from the start of "<html>" to the end of "</html>". Then paste it to 'Notepad' and save it with ".htm" at the end. You should now have a file like "Adder.htm" depending on what you called it. Double click this file and it will open in your default web browser, though this script will probably only work in IE. Next find the thread you want to add, copy the text, and paste into the text box you will see once you start this script. Next click the button and it will give you the results.

E.g:
Start my script and in a new window open viewtopic.php?f=17&t=2529 . Highlight from the start of "Larry" to the end of the last "SD". Right click and pick "Copy". Switch back to the window you have the script open in, left click the text box, then right click the text box and pick "Paste". Lastly left click the command button which is labeled "Go". It will then give you the new data it's just added up.


Top
 Profile  
 
 Post subject: Re: Cashout adder
PostPosted: Sat Jun 07, 2008 5:24 pm 
Offline
User avatar

Joined: Fri Jul 21, 2006 8:34 am
Posts: 417
Location: Damn the torpedoes, full speed ahead!!!
That is a kewl script Ralph!!!!


Top
 Profile  
 
 Post subject: Re: Cashout adder
PostPosted: Sat Jun 07, 2008 8:48 pm 
Offline
User avatar

Joined: Fri Feb 24, 2006 1:38 am
Posts: 726
Location: New Zealand
Thanks. Not sure if it will have a use next month, but will have to wait and see.

_________________
It angers me that bottles can say for you to shake well before use, but don't have to say to put the cap back on 1st.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group