Jump to content
  • 0

[Solved] H> Modified Hourly Points


GM Winter

Question


  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.15
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

hello i want to disable hourly points in characters who are in autotrade mode can anyone had an idea to do it thanks in advance

heres the Script:
 

Quote

-    script    hourly_point_main    -1,{
 
    OnInit:
        .npc_name$ = strnpcinfo(3);
        bindatcmd "check",.npc_name$+"::OnAtcommand";
        end;
 
    OnAtcommand:
        dispbottom "Accumulated "+#daily_minute_count;
        end;
 
    OnUpdate:
        #daily_minute_count++;
        deltimer .npc_name$+"::OnUpdate";
        switch ( #daily_minute_count ) {
            default:
                break;
            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;
        }
 
    OnPCLoginEvent:
        addtimer ( 60 * 1000 ), .npc_name$+"::OnUpdate";
        end;
}



 

Edited by chadness
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

-	script	hourly_point_main	-1,{
 
	OnInit:
		.npc_name$ = strnpcinfo(3);
		bindatcmd "check",.npc_name$+"::OnAtcommand";
		end;
 
	OnAtcommand:
		dispbottom "Accumulated "+#daily_minute_count;
		end;
 
	OnUpdate:
		if (checkvending()) {
			dispbottom "Hourly point stopped due to vending.";
			end;
		}
		#daily_minute_count++;
		deltimer .npc_name$+"::OnUpdate";
		switch ( #daily_minute_count ) {
			default:
				break;
			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;
		}
 
	OnPCLoginEvent:
		addtimer ( 60 * 1000 ), .npc_name$+"::OnUpdate";
		end;
}

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  924
  • Reputation:   166
  • Joined:  04/05/13
  • Last Seen:  

use checkvending()

\rathena\doc\script_commands.txt

Lines 3909

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.15
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

Just now, Start_ said:

use checkvending()

can you elaborate more or do an example

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  398
  • Reputation:   246
  • Joined:  07/04/19
  • Last Seen:  

while(checkvending() >= 1) {
		if( .@mes$ == "" ) {
			dispbottom set( .@mes$, "The hourly points event stopped because you were vending!" );
			set @hourly_points_timer, 0;
		}
		sleep2 .delay;
	}

 

On 9/8/2021 at 8:23 PM, chadness said:

no error but its not working still getting hourly points while in autotrade mode

we already gave you an idea. you can use search engine to solve your problem.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.15
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

On 9/7/2021 at 9:55 PM, BeWan said:
while(checkvending() >= 1) {
		if( .@mes$ == "" ) {
			dispbottom set( .@mes$, "The hourly points event stopped because you were vending!" );
			set @hourly_points_timer, 0;
		}
		sleep2 .delay;
	}

hello thanks but where in the script exactly can i put this 

no error but its not working still getting hourly points while in autotrade mode

 

On 9/8/2021 at 9:22 PM, BeWan said:

we already gave you an idea. you can use search engine to solve your problem.

okay sir thanks anyway ?

thanks master your the best! 

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...