Former Member
inherit
guest@proboards.com
177794
0
Nov 24, 2024 4:40:22 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jul 1, 2013 9:13:22 GMT -8
Hello!
Back on the old V4 system I had as code that used to generate a random number between 1 and one hundred. We used to use it for battles and tournaments. If a placer clicks the button it would create a random number that would show up at the bottom of a post. The higher the number the more damage the character would take ect. It would even generate a miss at certain times.
If its possible id like to ask if someone could create this plug in.
I would need to be able to change the variables like how many times a miss would come into play. The range of the numbers like from what to what.
I would also need to somehow have it rigged so that players cannot go back and edit the thread to change the number.
If its possible it would be appreciated!
thanks!
|
|
inherit
58740
0
Aug 20, 2024 7:29:21 GMT -8
®i©hie
I'm not very active here anymore thanks to my full-time job. - 12/27/23
14,036
September 2005
soe
|
Post by ®i©hie on Jul 2, 2013 14:36:39 GMT -8
Hello! Back on the old V4 system I had as code that used to generate a random number between 1 and one hundred. We used to use it for battles and tournaments. If a placer clicks the button it would create a random number that would show up at the bottom of a post. The higher the number the more damage the character would take ect. It would even generate a miss at certain times. If its possible id like to ask if someone could create this plug in. I would need to be able to change the variables like how many times a miss would come into play. The range of the numbers like from what to what. I would also need to somehow have it rigged so that players cannot go back and edit the thread to change the number. If its possible it would be appreciated! thanks! Hi, this would be fairly simple, just need to ask a few questions: 1) where do you want the button to show? 2) do you want it to submit the post apon clicking it? 3) is it gonna just add the text to the end of the post, or is that text alone gonna be in the post? how about entering a % for the chance of a miss?
|
|
Former Member
inherit
guest@proboards.com
177794
0
Nov 24, 2024 4:40:22 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jul 2, 2013 17:51:47 GMT -8
1) where do you want the button to show?. Would it be possible to put it at the bottom of post say where the spell check and create thread is? I also need it to show up on just a certain board, not on every board. Like say where the arena would be if that's possible?
2) do you want it to submit the post apon clicking it? Yes but is there a way to set it so the player cannot tamper with the results?
3) is it gonna just add the text to the end of the post, or is that text alone gonna be in the post? Add the text at the end of the post please?
how about entering a % for the chance of a miss? The last code was set at about 15% but can that be edible if people complain if it misses too much?
|
|
inherit
58740
0
Aug 20, 2024 7:29:21 GMT -8
®i©hie
I'm not very active here anymore thanks to my full-time job. - 12/27/23
14,036
September 2005
soe
|
Post by ®i©hie on Jul 7, 2013 10:23:23 GMT -8
|
|
Former Member
inherit
guest@proboards.com
177794
0
Nov 24, 2024 4:40:22 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jul 7, 2013 16:35:41 GMT -8
It seems to be glitching a bit when I click it. When I ran the test it sometimes removes the post text. Would it be possible to add the attack feature right to the reply button? Edit: Also when i tested it it made the monetary plug in stop working.
|
|
inherit
58740
0
Aug 20, 2024 7:29:21 GMT -8
®i©hie
I'm not very active here anymore thanks to my full-time job. - 12/27/23
14,036
September 2005
soe
|
Post by ®i©hie on Jul 8, 2013 8:18:14 GMT -8
It seems to be glitching a bit when I click it. When I ran the test it sometimes removes the post text. Would it be possible to add the attack feature right to the reply button? Edit: Also when i tested it it made the monetary plug in stop working. if you want nobody to able to edit the text, it needds to be added on submit, or by clicking a button that adds the text then submits the form. could you switch the order of the monetary plugin and this one, and see if that helps?
|
|
Former Member
inherit
guest@proboards.com
177794
0
Nov 24, 2024 4:40:22 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jul 10, 2013 6:11:20 GMT -8
It still seems to be glitching the same. Is there a way to take off the security and just have it applied when the player hits reply or quick reply?
|
|
inherit
58740
0
Aug 20, 2024 7:29:21 GMT -8
®i©hie
I'm not very active here anymore thanks to my full-time job. - 12/27/23
14,036
September 2005
soe
|
Post by ®i©hie on Jul 10, 2013 15:34:36 GMT -8
It still seems to be glitching the same. Is there a way to take off the security and just have it applied when the player hits reply or quick reply? "when the player hits reply or quick reply" hitting quick reply, i assume you mean when they submit a reply via the quick reply? that would basically be the same as adding it on submit. so i can do that. Edit: Done. please re-download. @greedsins
|
|
Former Member
inherit
guest@proboards.com
177794
0
Nov 24, 2024 4:40:22 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jul 11, 2013 12:57:58 GMT -8
It still blocks the money plug in, even when I move it around. Also would there be a way to have it show attack OR miss not both at the same time? If its ok? If it helps this was my old code. All it did was add a number or a miss when you put in your post and click reply. <script type="text/Javascript"> // Do not redistribute without permission of the creator
var mi = 25; // Chance of missing on each post var ma = 100; // Max number to be used. Range of possible will be 0-this number.
// Don't edit if(document.postForm && document.postForm.message){ var dGLOBAL = -1; if(document.postForm.message.value.match(/\[RESULT:\s(.+?)\]$/)){ var n = RegExp.$1; if(location.href.match(/quote=/i)){ dGLOBAL = -1; } else if(n == "Miss"){ dGLOBAL = "Miss"; } else if(isNaN(n-0) || n < 0 || n > 100){ dGLOBAL = -1; } else { dGLOBAL = n; } document.postForm.message.value = document.postForm.message.value.replace(/\[RESULT:\s.+?\]/, "ATK"); } function dothisStuff(){ if(document.postForm.message.value.length < 1) return; var r1 = Math.floor(Math.random()*100); if(dGLOBAL != -1){ var d = dGLOBAL; } else if(r1 <= mi){ var d = "Miss"; } else { var d = Math.floor(Math.random()*ma); } document.postForm.message.value = document.postForm.message.value.replace(/ATK/, "[RESULT: "+d+"]"); } var n = document.postForm.nextaction.nextSibling; if(document.addEventListener){ n.addEventListener("click", dothisStuff, false); } else { n.attachEvent("onclick", dothisStuff); } } </script>
|
|
inherit
58740
0
Aug 20, 2024 7:29:21 GMT -8
®i©hie
I'm not very active here anymore thanks to my full-time job. - 12/27/23
14,036
September 2005
soe
|
Post by ®i©hie on Jul 14, 2013 10:58:48 GMT -8
i can't seem to get it to work with the monetary plugin, maybe Peter can figure it out.
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Jul 14, 2013 11:57:54 GMT -8
®i©hie, I had a quick look. Firstly, your for loop in the "rpgdamage" function is incorrect. The length of forms on the page when I tested was 1 (quick reply), your loop condition fails right of the bat because your length is set to 0 (length - 1), and you are only checking > 0. Secondly, just wrap jQuery around the form element and then call the submit handler. I would really suggest using jQuery, there are a few things in there that could be optimised (granted, it's a small script, but forums are JS heavy now), at least fetch the form with jQuery (eg $(".form_post_quick_reply")) instead of looping, and try to reduce repeated dot notations by caching (I'm guilty of this).
|
|
inherit
58740
0
Aug 20, 2024 7:29:21 GMT -8
®i©hie
I'm not very active here anymore thanks to my full-time job. - 12/27/23
14,036
September 2005
soe
|
Post by ®i©hie on Jul 15, 2013 16:47:03 GMT -8
®i©hie, I had a quick look. Firstly, your for loop in the "rpgdamage" function is incorrect. The length of forms on the page when I tested was 1 (quick reply), your loop condition fails right of the bat because your length is set to 0 (length - 1), and you are only checking > 0. Secondly, just wrap jQuery around the form element and then call the submit handler. I would really suggest using jQuery, there are a few things in there that could be optimised (granted, it's a small script, but forums are JS heavy now), at least fetch the form with jQuery (eg $(".form_post_quick_reply")) instead of looping, and try to reduce repeated dot notations by caching (I'm guilty of this). hey Peter i'm gonna pm you a link to an editable version of the plugin. maybe you can figure out why the monetary plugin doesn't increase the $ amount when the post is submited.
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Jul 15, 2013 17:01:03 GMT -8
®i©hieOk, I'll try and look at it later on in the day, it's 2am here, so I'll try and take a look and message you back later in the day after work.
|
|
Former Member
inherit
guest@proboards.com
177794
0
Nov 24, 2024 4:40:22 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jul 16, 2013 0:47:56 GMT -8
Thanks you guys! I really appreciate you taking your time out of your work to help me! ^^ Both of you!
|
|
inherit
58740
0
Aug 20, 2024 7:29:21 GMT -8
®i©hie
I'm not very active here anymore thanks to my full-time job. - 12/27/23
14,036
September 2005
soe
|
Post by ®i©hie on Jul 16, 2013 14:34:56 GMT -8
Thanks you guys! I really appreciate you taking your time out of your work to help me! ^^ Both of you! hopefully with Peter's help we'll get this sorted.
|
|