RSBDavid Posted March 3, 2009 Share Posted March 3, 2009 I remember before the rollback that there was a thread where users posted various sourcecodes. I am going to remake a thread simular to it. If you have a sourcecode you would like to share post it here. I read throught the first 10 pages and didn't find so I am sure it was lost in the rollback. Use this format: Title: Language: Difficulty to Understand: What it does: The code: [hide=My Contribution]Here is mine: Title: Ballers Combat stat retrieving function Language: vb.net Difficulty to Understand [1/10]: 5 What it does: It retrieves the combat stats of a player from the highscores. Function getCombatStats(ByVal username As String) Dim x As New System.Net.WebClient Dim rawData As String Try rawData = x.DownloadString("http://hiscore.runescape.com/index_lite.ws?player=" _ & username) ' download the raw stat data for the user Catch ex As Exception End Try Dim statParse() As String statParse = rawData.Split(",") ' splits the data based on commas since that is what you see if you were to view the raw data Me.txtAttack.Text = statParse(3) ' get attack level Me.txtDef.Text = statParse(5) ' get defence level Me.txtStr.Text = statParse(7) ' get strength level Me.txtHp.Text = statParse(9) ' get hp level Me.txtRange.Text = statParse(11) ' get range level Me.txtPrayer.Text = statParse(13) ' get prayer level Me.txtMagic.Text = statParse(15) ' get magic level Me.txtSumm.Text = statParse(49) ' get summoning level 'if any of the values return -1, replaces and sets it to level 1 If Me.txtSumm.Text = "-1" Then Me.txtSumm.Text = "1" If Me.txtHp.Text = "-1" Then Me.txtHp.Text = "1" If Me.txtAttack.Text = "-1" Then Me.txtAttack.Text = "1" If Me.txtStr.Text = "-1" Then Me.txtStr.Text = "1" If Me.txtDef.Text = "-1" Then Me.txtDef.Text = "1" If Me.txtPrayer.Text = "-1" Then Me.txtPrayer.Text = "1" If Me.txtMagic.Text = "-1" Then Me.txtMagic.Text = "1" If Me.txtRange.Text = "-1" Then Me.txtRange.Text = "1" Return Nothing End Function usage: You need to have textboxes with corresponding names to those above. getCombatStats("username") You can use the same method to get non-combat stats as well as levels and ranks. Here is a picture of it in use. (Ignore the stuff outside of the green box) It is useful if you want to look up the stats of someone you are going to fight in a pvp world or anywhere else.[/hide] [software Engineer] - [Ability Bar Suggestion] - [Gaming Enthusiast] Link to comment Share on other sites More sharing options...
Slayr Posted March 4, 2009 Share Posted March 4, 2009 Fine, here's my dynamic signature base that I wrote a while back! Written in PHP, and the actual signature isn't finished yet. Signature: http://pastebin.com/meed94c4 (code is 192 lines long...so off to the pastebin!!) I'll finish it if enough people want me to... Link to comment Share on other sites More sharing options...
Sbrideau Posted March 4, 2009 Share Posted March 4, 2009 bballer, what version of vb.net is that? Link to comment Share on other sites More sharing options...
RSBDavid Posted March 4, 2009 Author Share Posted March 4, 2009 bballer, what version of vb.net is that? 2008 [software Engineer] - [Ability Bar Suggestion] - [Gaming Enthusiast] Link to comment Share on other sites More sharing options...
dsavi Posted March 4, 2009 Share Posted March 4, 2009 Title: Random number generator Language: Written here in PHP, but it's easy to write in other languages. Difficulty to Understand: Pretty difficult What it does: Returns a random number. The code: [hide=] <? function randomNumGen() { return 4; //Chosen by fair dice roll //guaranteed to be random } ?> [/hide] Link to comment Share on other sites More sharing options...
Slayr Posted March 5, 2009 Share Posted March 5, 2009 Title: Random number generator Language: Written here in PHP, but it's easy to write in other languages. Difficulty to Understand: Pretty difficult What it does: Returns a random number. The code: [hide=] <? function randomNumGen() { return 4; //Chosen by fair dice roll //guaranteed to be random } ?> [/hide] That won't generate a random number.... Edit: I don't get the joke :( Link to comment Share on other sites More sharing options...
Makoto_the_Phoenix Posted March 5, 2009 Share Posted March 5, 2009 I got the joke dsavi_x4. You read xkcd too, eh? :P Here's my contribution. Title: MTK Calculator (Miscellania) Language: Java Difficulty to Understand: Relatively straightforward What it does: It calculates how long (in days) it would take to reduce your stockpile of cash in Miscellania to around 100gp (the point of no concern). The code: http://pastebin.com/m17e2bfa2 If it disappears and you're interested, PM me so I can put it back up. Linux User/Enthusiast | Full-Stack Software Engineer | Stack Overflow Member | GIMP User...Alright, the Elf City update lured me back to RS over a year ago. Link to comment Share on other sites More sharing options...
dsavi Posted March 7, 2009 Share Posted March 7, 2009 I got the joke dsavi_x4. You read xkcd too, eh? :P Yeah I love it. :D sudo make me a sandwich FTW. :lol: Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now