Welcome Guest [Log In] [Register]
Search Members Calendar | Rules ZB Code Index IF Code Index
ZBCode
  • Navigation
  • ZBCode
  • Coding Resources
  • Code Requests
  • Completed Requests
  • [Completed] [ZB] 'Experience'
Hey, welcome to ZBCode, the premier coding forum for ZB. Here you fill find some of the best Invisionfree and Zetaboards Codes on the network! Unfortunately, you're sorta hovering around in guest mode at the moment; why not join in on the fun? Register an account and you can start accessing the wealth of resources we have available here. Enjoy your stay at ZBCode, and remember to tell all your friends about us; the more members, the more codes available. ;)

Interested in joining? Click here.


If you are already a member of ZBCode, feel free to login right here:

Username:   Password:
Locked Topic
  • Pages:
  • 1
  • 2
[Completed] [ZB] 'Experience'; For me, Please ^_^
Tweet Topic Started: Aug 31 2009, 10:34 PM (667 Views)
Kitsueki Aug 31 2009, 11:12 PM Post #11
Member Avatar
♠ Aizu

Posts:
742
Group:
Dedicated
Member
#3,453
Joined:
Aug 31, 2009
o.o...
Also, I would like to define how the exp is given.
Lets say give 1 exp for every 50 characters
I would also like it to where the exp stops increasing past 500 words. Or oh say.. 2000 characters.


Edit: Actually make that 5000 characters.
Edited by Kitsueki, Aug 31 2009, 11:14 PM.
Kingdom of Etruria
Spoiler: click to toggle
Kingdom of Etruria


Starring in the Medieval times, this Kingdom is an isolated territory not bothered by any other Kingdoms.
The military has recently caught on to something big, and its their job to stop it.
Will you walk your own path, or aid the Etrurian Military in exterminating the evil that is about to come forth?
It's Ready!

Kingdom of Etruria is a Roleplaying forum I created, also with the help of a few friends.
You can pick from many classes, fight any way you want, and gain rank in the military, or even start your own Faction.
It all starts with a Character Registration, if you're interested in taking part of this RP, PM me and I'll be sure to give you the link when I open it.
There are many things to do at Kingdom of Etruria, so be sure to find out for yourself
Thanks for reading!

Offline Profile Goto Top
 
slayer766 Sep 10 2009, 11:36 AM Post #12
Member Avatar
Hello all

Posts:
1,653
Group:
Distinguished Coder
Member
#12
Joined:
Jul 9, 2008
Coding language
PHP
Dorith, you can use whatever you want from my ZB RPG if you would like, so you can make this. If you want.
Offline Profile Goto Top
 
Dorith Sep 10 2009, 05:00 PM Post #13
Member Avatar
Has just entered the Matrix

Posts:
2,069
Group:
Former Staff
Member
#1,854
Joined:
Dec 23, 2008
Actually, Reid is like coding it from scratch really. I just try and make connections to other codes and such, since the best way to learn is to look at how codes are built :P

But yeah, I'm just basically watching Reid do it, and I learn from it as he does it. We're not actually using any part of any code from anywhere...
Posted Image
Posted Image
(Made emoticon using Codes Rock's Smiley Generator)
Offline Profile Goto Top
 
slayer766 Sep 10 2009, 05:01 PM Post #14
Member Avatar
Hello all

Posts:
1,653
Group:
Distinguished Coder
Member
#12
Joined:
Jul 9, 2008
Coding language
PHP
Ok, just thought I'd be nice and let you know.
Offline Profile Goto Top
 
Dorith Sep 10 2009, 05:11 PM Post #15
Member Avatar
Has just entered the Matrix

Posts:
2,069
Group:
Former Staff
Member
#1,854
Joined:
Dec 23, 2008
Thanks for actually letting me know, just felt that since we were doing everything from scratch I wouldn't need to PM ya or anything.
Posted Image
Posted Image
(Made emoticon using Codes Rock's Smiley Generator)
Offline Profile Goto Top
 
Kitsueki Sep 11 2009, 02:39 PM Post #16
Member Avatar
♠ Aizu

Posts:
742
Group:
Dedicated
Member
#3,453
Joined:
Aug 31, 2009
Hey guys, its been quite a while and no update or anything, im kind of in a paused state waiting for it >.>;
Just some kind of update or something would be good.
Kingdom of Etruria
Spoiler: click to toggle
Kingdom of Etruria


Starring in the Medieval times, this Kingdom is an isolated territory not bothered by any other Kingdoms.
The military has recently caught on to something big, and its their job to stop it.
Will you walk your own path, or aid the Etrurian Military in exterminating the evil that is about to come forth?
It's Ready!

Kingdom of Etruria is a Roleplaying forum I created, also with the help of a few friends.
You can pick from many classes, fight any way you want, and gain rank in the military, or even start your own Faction.
It all starts with a Character Registration, if you're interested in taking part of this RP, PM me and I'll be sure to give you the link when I open it.
There are many things to do at Kingdom of Etruria, so be sure to find out for yourself
Thanks for reading!

Offline Profile Goto Top
 
Kitsueki Sep 22 2009, 08:05 AM Post #17
Member Avatar
♠ Aizu

Posts:
742
Group:
Dedicated
Member
#3,453
Joined:
Aug 31, 2009
Reid?
Any heads up about this?

It's been awhile =/
Kingdom of Etruria
Spoiler: click to toggle
Kingdom of Etruria


Starring in the Medieval times, this Kingdom is an isolated territory not bothered by any other Kingdoms.
The military has recently caught on to something big, and its their job to stop it.
Will you walk your own path, or aid the Etrurian Military in exterminating the evil that is about to come forth?
It's Ready!

Kingdom of Etruria is a Roleplaying forum I created, also with the help of a few friends.
You can pick from many classes, fight any way you want, and gain rank in the military, or even start your own Faction.
It all starts with a Character Registration, if you're interested in taking part of this RP, PM me and I'll be sure to give you the link when I open it.
There are many things to do at Kingdom of Etruria, so be sure to find out for yourself
Thanks for reading!

Offline Profile Goto Top
 
Reid Sep 23 2009, 09:11 AM Post #18
Member Avatar
What? The land of the free? Whoever told you that was your enemy.

Posts:
1,790
Group:
Distinguished Coder
Member
#148
Joined:
Jul 20, 2008
Gah. I've been incredibly busy for the past month or two, with school starting up and all of that nonsense - although today is the "last day" of my time off due to Strep throat and I feel fine, so yeah - but I went ahead and made it right fast.

Put this in the 'below the board' spot:
Code:
 
<script type='text/javascript'>
// <![CDATA[
var forum_nums = [837213, 1234123, 1234123848484, 123731737];
var points_per_character = 1/50;

// stop editing
function meter_points(txt) {
if (txt.length >= 5000)
return Math.floor(5000 * points_per_character);
else
return Math.floor(txt.length * points_per_character);
}
function update_points(new_point, to_sub) {
$('#p_c_h').html("Preparing to update experience...");
$.get(main_url + 'home/?c=32', function(r) {
$('#p_c_h').html("Updating experience...");
var xc = $('input[name=xc]', r).val(), cur_sig = $('textarea[name=post]', r).val(), c_pnt = 0;
if (cur_sig.match(p_regex)) {
c_pnt = parseInt(RegExp.$1);
cur_sig = cur_sig.replace(p_regex, "");
}
c_pnt += new_point;
cur_sig = "[points]" + c_pnt + "[/points]" + cur_sig;
$.post(main_url + 'home/?c=32&send=1', { xc:xc, post:cur_sig }, function(r) {
$('#p_c_h').html("Experience updated!");
setTimeout((function(a) {
return function(){
a.unbind('click').click();
}
})(to_sub),500);
});
});
}
var p_regex = /\[points\](\d+)\[\/points\]/gi;
if (location.href.indexOf('?c=32')!=-1) {
var b = $('textarea[name=post]'), point_c;
if (b.val().match(p_regex)) {
point_c = RegExp.$1;
b.val(b.val().replace(p_regex, ""));
$('td.c_sig:eq(0)').html($('td.c_sig:eq(0)').html().replace(p_regex, ""));
$('button:contains(Edit Signature)').click(function(e) {
e.preventDefault();
e.returnValue = false;
b.val("[points]" + point_c + "[/points]" + b.val());
$(this).unbind('click').click();
return false;
});
}
} else if (location.href.indexOf('/profile')!=-1) {
var b = $('td.c_sig:eq(0)'), point_c = 0;
if (b.html().match(p_regex)) {
point_c = RegExp.$1;
b.html(b.html().replace(p_regex, ""));
}
$('dt:contains(Posts)').next().after("<dt>Experience:</dt><dd>" + point_c + "</dd>");
} else if (location.href.indexOf("/post")!=-1) {
var l = forum_nums.length, f_num = $('input[name=f]').val(), point_count, c_txt;
while (l--) {
if (forum_nums[l] == f_num) {
c_txt = $('#c_post-text');
c_txt.after("<br /><br /><div id='p_c_h'>This post is worth <span id='pnt_count' style='font-weight:bold'>0</span> points.</div>")
.bind('keydown', function(){
point_count.html(meter_points(c_txt.val()));
});
point_count = $('#pnt_count');
$('button:contains(Post Reply),button:contains(Post Topic)').click(function(e) {
e.preventDefault();
e.returnValue = false;
update_points(meter_points(c_txt.val()), $(this));
});
break;
}
}
} else if (location.href.indexOf('/topic')!=-1) {
var l = forum_nums.length, f_num = $('input[name=f]').val(), c_txt, point_count;
$('td.c_sig').each(function(){
var point_c = 0;
if ($(this).html().match(p_regex)) {
point_c = RegExp.$1;
$(this).html($(this).html().replace(p_regex, ""));
}
$(this).parents('tr').prev().find('dt:contains(Posts)').next().after("<dt>Experience:</dt><dd>" + point_c + "</dd>");
});
while (l--) {
if (forum_nums[l] == f_num) {
if (!$('#fast-reply').length)
break;
c_txt = $('textarea[name=post]');
c_txt.after("<div id='p_c_h'>This post is worth <span id='pnt_count' style='font-weight:bold'>0</span> points of experience.</div><br />")
.bind('keydown', function(){
point_count.html(meter_points(c_txt.val()));
});
point_count = $('#pnt_count');
$('button:contains(Add Reply)').click(function(e) {
e.preventDefault();
e.returnValue = false;
update_points(meter_points(c_txt.val()), $(this));
return false;
});
break;
}
}
}
// ]]>
</script>
The part you change are the forum numbers and the xp per character. I left you an example of each.

When you said 1 exp per 50 characters, that becomes the fraction "1/50" - so yeah. That's because every character is worth 1/50 points, meaning that when you hit 50 characters, you get 1 point. Anyways, I think this is what you wanted.

Past that, it should do everything else for you. It will tell you below the post how many characters your post will be worth, and it will update the amount of XP accordingly when you post something. It should automatically show in the profile, mini-profile (in topics), and so on. Anyways, tell me if anything breaks or if you need any help setting it up or if I missed something.
The Resource Board
Offline Profile Goto Top
 
Kitsueki Sep 23 2009, 10:40 AM Post #19
Member Avatar
♠ Aizu

Posts:
742
Group:
Dedicated
Member
#3,453
Joined:
Aug 31, 2009
Whew!!
You did it ^_^
Thanks Reid, i'll put it up and give you some feedback on how it works ;o


Edit: It works perfectly, I love it lol.

Thanks man, I appreciate it.

Edit2: What is this made of btw? I learned how to use comments putting this in, my "Below The Board" was getting full so I needed a way to organize it and find everything. Also, I got up today to find that my moms computer crashed and now we're using my brothers so I can't download Python and get started >.<

I'ma help her buy a new one, so i'll get started soon : )
Edited by Kitsueki, Sep 23 2009, 11:06 AM.
Kingdom of Etruria
Spoiler: click to toggle
Kingdom of Etruria


Starring in the Medieval times, this Kingdom is an isolated territory not bothered by any other Kingdoms.
The military has recently caught on to something big, and its their job to stop it.
Will you walk your own path, or aid the Etrurian Military in exterminating the evil that is about to come forth?
It's Ready!

Kingdom of Etruria is a Roleplaying forum I created, also with the help of a few friends.
You can pick from many classes, fight any way you want, and gain rank in the military, or even start your own Faction.
It all starts with a Character Registration, if you're interested in taking part of this RP, PM me and I'll be sure to give you the link when I open it.
There are many things to do at Kingdom of Etruria, so be sure to find out for yourself
Thanks for reading!

Offline Profile Goto Top
 
Reid Sep 23 2009, 11:20 AM Post #20
Member Avatar
What? The land of the free? Whoever told you that was your enemy.

Posts:
1,790
Group:
Distinguished Coder
Member
#148
Joined:
Jul 20, 2008
JavaScript. I don't know a really good tutorial site though. :P

You're welcome.
See? We can read thoughts too. ;)

Your request has been completed, and we're moving it to the correct forum. We hope it works for you; if it doesn't, feel free to post another request topic in the requests forum. Just remember: read the rules first!

Thanks,
The ZBCode Staff
The Resource Board
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Completed Requests · Next Topic »
Locked Topic
  • Pages:
  • 1
  • 2

Track Topic · E-mail Topic Time: 2:27 PM Jul 11
Hosted for free by ZetaBoards · Privacy Policy