Hey guys, it's WP (Wariopower).
I've been posting numerous mIRC Snippets for a while so I decided to post a snippet for the first time in a different language; that being Java. So, this is my first Java snippet and it's called Current Date. Ya know those times when you can't remember what the date is? Well this should help, hopefully. :P You can use a program like Eclipse or something of that sort to use it! Thanks guys, enjoy! =] EDIT: Fixed problems.
~ WP
~ This script was made by Wariopower of #WarizardWorks on irc.purplesurge.com ~
import java.util.Calendar;
public class CurrentDate {
public static void main(String[] args) {
Calendar cal = Calendar.getInstance();
int day = cal.get(Calendar.DATE);
int month = cal.get(Calendar.MONTH) + 1;
int year = cal.get(Calendar.YEAR);
int dow = cal.get(Calendar.DAY_OF_WEEK);
int dom = cal.get(Calendar.DAY_OF_MONTH);
int doy = cal.get(Calendar.DAY_OF_YEAR);
System.out.println("The Current Date is...: " + cal.getTime());
}
}
well, I went ahead and looked it up- the constructors are declaired as protected- meaning they can only be accessed by the class or a subclass..... I have no idea why it is like that, or how to get around it.
Perhaps you should try a better Class?
...
and compile before posting it... (I'm still not sure where you are writing it, but Eclipse is probably best.)
looks like you guys can help me ..i need the nick completions to apears anywhere in the text im writing and not only at the begining (default)..here is the part i thing it has to be change ..
/corrige.nicks {
if ( $right($1,1) = : ) {
%nc = 0
%nn = $nick(#,0)
:1
inc %nc 1
if (%nc > %nn) goto 3
%nac = $nick(#,%nc)
%ntm = $len(%nac)
%nsf = $ncmuestra(%nac)
%npart = $remove( $1 ,:)
if (%npart isin %nac) {
%texto = %nsf $+ $right(%texto,$calc($len(%texto) - $len($$1)))
goto 3
}
else { goto 1 }
:3
unset %nac %ntm %nsf %nn %nc %npart
}
elseif ($$1 ison #) {
; %texto = $replace(%texto,$$1,$ncmuestra($nick(#,$nick(#,$$1))))
%texto = $ncmuestra($nick(#,$nick(#,$$1))) $+ $right(%texto,$calc($len(%texto) - $len($$1)))
}
}
ncmuestra {
return $+ %nc1.c $+ $+ %nc1 $+ [ $ $+ [ texto $+ [ %ncnick ] $+ ($$1) ] ] $+ $+ %nc2.c $+ $+ %nc2 $+
}