Jump to content
  • 0

H>Test Hourly Points


Sallycantdance

Question


  • Group:  Members
  • Topic Count:  225
  • Topics Per Day:  0.14
  • Content Count:  798
  • Reputation:   12
  • Joined:  12/04/20
  • Last Seen:  

hello everyone can i ask for help i would like to test this script i would like to change the 1 hour in 1 minute so i can test it but i dont know how to compute it can someone help me


 

Quote

-    script    hourly_point_main    -1,{
     OnInit:
        .npc_name$ = strnpcinfo(3);
        .reward_minutes = 60;
        bindatcmd("check", .npc_name$ + "::OnAtcommand");
        end;
 
    OnAtcommand:
        dispbottom("Accumulated " + #daily_minute_count);
        end;
 
    OnPCLoginEvent:
        addtimer(.reward_minutes * 60000, .npc_name$ + "::OnUpdate");
        end;

    OnUpdate:
        deltimer(.npc_name$ + "::OnUpdate");
        addtimer(.reward_minutes * 60000, .npc_name$ + "::OnUpdate");

        if (checkvending() & 2) {
            end;
        }

        #daily_minute_count += .reward_minutes;

        switch(#daily_minute_count) {
            case 60: // 60 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 120: // 120 minutes 
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 180: // 180 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 240: // 240 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 300: // 300 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 360: // 360 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 420: // 420 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 480: // 480 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                #daily_minute_count = 0; // reset.
                break;
            default:
                break;
        }
}

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  245
  • Reputation:   93
  • Joined:  06/30/18
  • Last Seen:  

-    script    hourly_point_main    -1,{
     OnInit:
        .npc_name$ = strnpcinfo(3);
        .reward_minutes = 1;
        bindatcmd("check", .npc_name$ + "::OnAtcommand");
        end;
 
    OnAtcommand:
        dispbottom("Accumulated " + #daily_minute_count);
        end;
 
    OnPCLoginEvent:
        addtimer(.reward_minutes * 10000, .npc_name$ + "::OnUpdate");
        end;

    OnUpdate:
        deltimer(.npc_name$ + "::OnUpdate");
        addtimer(.reward_minutes * 10000, .npc_name$ + "::OnUpdate");

        if (checkvending() & 2) {
            end;
        }

        #daily_minute_count += .reward_minutes;

        switch(#daily_minute_count) {
            case 60: // 60 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 120: // 120 minutes 
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 180: // 180 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 240: // 240 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 300: // 300 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 360: // 360 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 420: // 420 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 480: // 480 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                #daily_minute_count = 0; // reset.
                break;
            default:
                break;
        }
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  225
  • Topics Per Day:  0.14
  • Content Count:  798
  • Reputation:   12
  • Joined:  12/04/20
  • Last Seen:  

18 hours ago, Winterfox said:
-    script    hourly_point_main    -1,{
     OnInit:
        .npc_name$ = strnpcinfo(3);
        .reward_minutes = 1;
        bindatcmd("check", .npc_name$ + "::OnAtcommand");
        end;
 
    OnAtcommand:
        dispbottom("Accumulated " + #daily_minute_count);
        end;
 
    OnPCLoginEvent:
        addtimer(.reward_minutes * 10000, .npc_name$ + "::OnUpdate");
        end;

    OnUpdate:
        deltimer(.npc_name$ + "::OnUpdate");
        addtimer(.reward_minutes * 10000, .npc_name$ + "::OnUpdate");

        if (checkvending() & 2) {
            end;
        }

        #daily_minute_count += .reward_minutes;

        switch(#daily_minute_count) {
            case 60: // 60 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 120: // 120 minutes 
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 180: // 180 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 240: // 240 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 300: // 300 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 360: // 360 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 420: // 420 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 480: // 480 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                #daily_minute_count = 0; // reset.
                break;
            default:
                break;
        }
}

 

hello sir ive tried it and its not working theres no hourly reward every minute 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.02
  • Content Count:  51
  • Reputation:   33
  • Joined:  09/09/23
  • Last Seen:  

On 9/13/2024 at 10:00 PM, GM Winter said:

hello sir ive tried it and its not working theres no hourly reward every minute 

If you don't mind using a different script for an hourly reward system. Here's one that I made.

Spoiler
/*
	Author: Nyani
	Version 1.0
	----------------------------------------------
	Playtime System
	----------------------------------------------
	Changelogs
	1.0 - Initial Release
	
*/

-	script	PlaytimeCount	-1,{
    end;
OnPCLoginEvent:
    //if(BaseLevel < 30) end;
	@starttime$ = gettimestr("%Y-%m-%d %H:%M:%S", 21);
    message  strcharinfo(0),"Playtime Point System is now enabled. Please note that vending will disqualify you from gaining points.";
	addtimer 300000,"PlaytimeCount::OnPointUpdate"; // 5 minutes
	dispbottom "Play Point System start time: "+@starttime$;
    dispbottom "[ "+#playtimepts+"0/60 ] minutes completed.";
end;
OnPointUpdate:
    if ( checkvending(strcharinfo(0)) == 2 ){
        dispbottom "You have been removed from the Playtime Point System. Please re-log to opt-in again.";
        deltimer strnpcinfo(3)+"::OnPointUpdate";
        end;
    }
    @playtime += 1;
    if(@playtime == 2){
		@playtime = 0;
        #playtimepts += 1;
        if(#playtimepts == 6){
            #playtimepts = 0;
			#valkafkpts += 1;
            @playtime = 0;
            message strcharinfo(0),"[Playtime Points]: You have received your Playtime Reward at "+gettimestr("%Y-%m-%d %H:%M:%S", 21)+".";
			@prevtime$ = gettimestr("%Y-%m-%d %H:%M:%S", 21);
        }
    }
	deltimer "PlaytimeCount::OnPointUpdate";
	addtimer 300000,"PlaytimeCount::OnPointUpdate";
end;
OnPlaytimeCheck:
	dispbottom "Last Reward: "+@prevtime$;
	dispbottom "Minutes: "+#playtimepts+"0/60";
	dispbottom "Current points: "+#valkafkpts;
end;
OnInit:
	bindatcmd "playtime",strnpcinfo(0)+"::OnPlaytimeCheck";
end;
}

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...