Thread: Prayer drain process?

Results 1 to 4 of 4
  1. #1 Prayer drain process? 
    Registered Member
    Join Date
    May 2016
    Posts
    384
    Thanks given
    52
    Thanks received
    35
    Rep Power
    29
    Turmoil uses 5 prayer points per second.

    On runescape when turned on, after 0.6 seconds 3 prayer points are removed, after another 0.6 seconds 2 prayer points are removed.


    With this:

    Code:
    	for(int i = 0; i < drainRates[curses ? 1 : 0].length; i++) {
    			if(isPrayerActive) { 
    				removal += (1 / drainRates[curses ? 1 : 0][i]) * 1000;
    			}
    		}
    		
    		removal *= 0.6; //because rs processes per tick not per second
    Where the value of drainRate[][turmoil] = 0.2 (1 second devided by 5)

    with the modifier

    Code:
    removal *= 0.6;
    this results in 3 prayer points being removed EVERY SECOND instead of 3, then 2, then 3, etc...

    even using double opposed to integer, removal *= 0.6, is an exact number therefore fractions aren't used..
    donald trump approves this message
    Reply With Quote  
     

  2. #2  
    Donator


    Join Date
    Jul 2013
    Posts
    1,233
    Thanks given
    1
    Thanks received
    493
    Rep Power
    0
    Avalon correctly fixed this I believe as he made it on its own thread running at the tick of rs. Might help you out by taking a look at how andreas did it
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    May 2016
    Posts
    384
    Thanks given
    52
    Thanks received
    35
    Rep Power
    29
    Quote Originally Posted by 423 Million View Post
    Avalon correctly fixed this I believe as he made it on its own thread running at the tick of rs. Might help you out by taking a look at how andreas did it
    I looked at how Avalon did it and I'm pretty sure they've done it incorrectly, they're modifying the ticks with the drainRate and not the actual points to be removed, and Avalon has so much spaghetti code it's like solving a maze every time you goto...

    besides i'm sure there's a very easy way to control this, it's just going straight over my head

    Update: I guess a valid conclusion would be that 0.2 is incorrect, because Runescape wiki shows prayer drain via seconds and not ticks...
    donald trump approves this message
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    May 2016
    Posts
    384
    Thanks given
    52
    Thanks received
    35
    Rep Power
    29
    Quote Originally Posted by jhg023 View Post
    Every 0.6 seconds is 1 tick. You can use a ScheduledExecutorService to handle executing a Runnable at a fixed rate.
    I'm pretty sure the problem is that Wikipedia shows the prayer drain rates incorrectly. Well not 'incorrectly,' but to a whole number; they would show 5 seconds opposed to 5.05 seconds, etc...
    donald trump approves this message
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Prayer draining process
    By Java100 in forum Help
    Replies: 0
    Last Post: 01-13-2017, 05:11 AM
  2. The Correct Prayer draining
    By Profesor Oak in forum Informative Threads
    Replies: 32
    Last Post: 04-04-2010, 09:57 PM
  3. Project Czar - Remove Prayer Draining Tutorial
    By Pheonix in forum Tutorials
    Replies: 10
    Last Post: 08-30-2009, 07:47 AM
  4. [delta] Prayer draining.
    By lemby pk in forum Help
    Replies: 0
    Last Post: 03-14-2009, 11:16 PM
  5. npc effects: healing, prayer drain, etc
    By WH:II:DOW in forum Tutorials
    Replies: 12
    Last Post: 07-23-2008, 02:42 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •