how do i stop the script
const al_consecutive := 0; // number of consecutive items before a anti-macroer gump appears to ask to continue
const al_timeout := 15; // number of seconds the player has to press "continue"
any help plz
autoloop
-
zuluscripts
- New User
- Posts: 11
- Joined: Sat Aug 04, 2007 6:53 pm
autoloop
HMMM i still cant seem to take "continue" out im trying to have autoloop like 2000 but without the "continue" after 10 loops
-
zuluscripts
- New User
- Posts: 11
- Joined: Sat Aug 04, 2007 6:53 pm
autoloop
sorry my bad gere is the script
// AutoLoop.inc by Lapo 'Aspox' Luchini <lapo>
/*
** AutoLoop_init asks character how many time it wants to iterate
** [if "autoloop" CProp is set it doesn't ask but uses that value, unless is 0]
** AutoLoop_more retunrs the number of loops remaining
**
** Use like this (for a crafter-like skill):
**
** AutoLoop_init(who);
** while(AutoLoop_more()>0 && <material_not_finished>)
** <create_item>;
** endwhile
** AutoLoop_finish();
*/
use uo;
include "include/random";
const AL_consecutive := 10; // number of consecutive items before a anti-macroer gump appears to ask to continue
const AL_timeout := 15; // number of seconds the player has to press "continue"
var AL_number := 0;
var AL_remain := 0;
var AL_char;
var AL_delay;
var AL_charX;
var AL_charY;
var AL_setting;
// init the autoloop variables
function AutoLoop_init( character, max := 10000, delay := 6 )
AL_setting := CInt( GetObjProperty( character, "autoloop" ) );
if( !AL_setting )
SetObjProperty ( character, "autoloop", 0 );
AL_setting := 0;
endif
if( AL_setting = 0 )
AL_number := CInt( SendTextEntryGump(character, "How many loops? [0-"+max+"]", TE_CANCEL_ENABLE, TE_STYLE_NORMAL, 4));
else
AL_number := AL_setting;
endif
if( !AL_number )
AL_number := 0;
elseif( AL_number > max )
AL_number := max;
endif
AL_remain := AL_number;
AL_char := character;
AL_charX := AL_char.x;
AL_charY := AL_char.y;
AL_delay := delay;
endfunction
// he numer returned is the number of things STILL to do, use BEFORE creating, not after
function AutoLoop_more()
if( (AL_charX = AL_char.x) && (AL_charY = AL_char.y) )
if( AL_remain > 0 )
if( AL_remain != AL_number )
Sleep( AL_delay );
if( (AL_number - AL_remain) % AL_consecutive = 0)
if( !TimedYesNo(AL_char) )
AL_remain := -1;
AL_number := 0; // to print "looping aborted"
endif
endif
endif
if( AL_remain > 0 )
SendSysMessage( AL_char , "Looping [" + AL_remain + " more to go].", 3 , 89 );
AL_remain := CInt( AL_remain ) - 1;
endif
else
AL_remain := -1;
endif
else
SendSysMessage( AL_char , "You moved." , 3 , 89 );
AL_remain := -1;
AL_number := 0; // to print "looping aborted"
endif
return( AL_remain+1 );
endfunction
// to be used after all, to clean up the variables and print the finishing text
function AutoLoop_finish()
if( (AL_remain <0> AL_timeout)
SendSysMessage( who, "You waited too long to decide.", 3, 89 );
return( 0 );
elseif( res )
return( 1 );
else
return( 0 );
endif
*/
return(1);
endfunction
// AutoLoop.inc by Lapo 'Aspox' Luchini <lapo>
/*
** AutoLoop_init asks character how many time it wants to iterate
** [if "autoloop" CProp is set it doesn't ask but uses that value, unless is 0]
** AutoLoop_more retunrs the number of loops remaining
**
** Use like this (for a crafter-like skill):
**
** AutoLoop_init(who);
** while(AutoLoop_more()>0 && <material_not_finished>)
** <create_item>;
** endwhile
** AutoLoop_finish();
*/
use uo;
include "include/random";
const AL_consecutive := 10; // number of consecutive items before a anti-macroer gump appears to ask to continue
const AL_timeout := 15; // number of seconds the player has to press "continue"
var AL_number := 0;
var AL_remain := 0;
var AL_char;
var AL_delay;
var AL_charX;
var AL_charY;
var AL_setting;
// init the autoloop variables
function AutoLoop_init( character, max := 10000, delay := 6 )
AL_setting := CInt( GetObjProperty( character, "autoloop" ) );
if( !AL_setting )
SetObjProperty ( character, "autoloop", 0 );
AL_setting := 0;
endif
if( AL_setting = 0 )
AL_number := CInt( SendTextEntryGump(character, "How many loops? [0-"+max+"]", TE_CANCEL_ENABLE, TE_STYLE_NORMAL, 4));
else
AL_number := AL_setting;
endif
if( !AL_number )
AL_number := 0;
elseif( AL_number > max )
AL_number := max;
endif
AL_remain := AL_number;
AL_char := character;
AL_charX := AL_char.x;
AL_charY := AL_char.y;
AL_delay := delay;
endfunction
// he numer returned is the number of things STILL to do, use BEFORE creating, not after
function AutoLoop_more()
if( (AL_charX = AL_char.x) && (AL_charY = AL_char.y) )
if( AL_remain > 0 )
if( AL_remain != AL_number )
Sleep( AL_delay );
if( (AL_number - AL_remain) % AL_consecutive = 0)
if( !TimedYesNo(AL_char) )
AL_remain := -1;
AL_number := 0; // to print "looping aborted"
endif
endif
endif
if( AL_remain > 0 )
SendSysMessage( AL_char , "Looping [" + AL_remain + " more to go].", 3 , 89 );
AL_remain := CInt( AL_remain ) - 1;
endif
else
AL_remain := -1;
endif
else
SendSysMessage( AL_char , "You moved." , 3 , 89 );
AL_remain := -1;
AL_number := 0; // to print "looping aborted"
endif
return( AL_remain+1 );
endfunction
// to be used after all, to clean up the variables and print the finishing text
function AutoLoop_finish()
if( (AL_remain <0> AL_timeout)
SendSysMessage( who, "You waited too long to decide.", 3, 89 );
return( 0 );
elseif( res )
return( 1 );
else
return( 0 );
endif
*/
return(1);
endfunction