Jump to content

Rashed

Members
  • Posts

    49
  • Joined

  • Last visited

Posts posted by Rashed

  1. Script Access

    .Add

    ..Admin: auser Level7 *! $ial($2,1).addr

    ..Owner: auser Level4 $address($$2,1)

    ..Host: auser Level2 $address($$2,1)

    .Remove

    ..Admin: ruser Level7 *! $+ $ial($2,1).addr

    ..Owner: ruser Level4 $address($$2,1)

    ..Host: ruser Level2 $address($$2,1)



    This format not working on nick list menue

    the adding and removing not working

  2. I did for all codes

     

    when i close and re-enter

     

    * Attempting to join %#A\bKiss\bOf\bBliss, please wait, this could take a moment. If you find nothing happens, please re-attempt to join again. It's, more than likely, a problem with the server.
    -
    WHO Not enough parameters
    -
    #SCRIPTDET Unknown command
    -
    * Socket: CHAN.%#A\bKiss\bOf\bBliss has closed.
    -
    [23:46] Closing Link: Black♞Horse [~0264aa8bb820e7dd79f6aec28eb2535f@BuzzenPassport] (Excess Flood)
    -
    WHO Not enough parameters
    These messages come , then the script makes hop and rejoin again
    i use many local time messages for welcoming and informations
  3. What are the possible reasons?


    #SCRIPTDET Unknown command

    -

    #SCRIPTDET Unknown command

    -

    #SCRIPTDET Unknown command

    -

    #SCRIPTDET Unknown command

    -

    #SCRIPTDET Unknown command

    -

    #SCRIPTDET Unknown command

    -

    #SCRIPTDET Unknown command

    -

    #SCRIPTDET Unknown command

    -

    #SCRIPTDET Unknown command

    -

    WHO Not enough parameters

    -

    #SCRIPTDET Unknown command

    -

    #SCRIPTDET Unknown command

    -

    #SCRIPTDET Unknown command

    -

    #SCRIPTDET Unknown command

    -

    #SCRIPTDET Unknown command

    -

    #SCRIPTDET Unknown command

    -

    #SCRIPTDET Unknown command

    -

    #SCRIPTDET Unknown command

    -

    #SCRIPTDET Unknown command

    -

    #SCRIPTDET Unknown command

  4. ok it works now

    if i want it to be a message in chat not eco that would be

     

    echo $chan [Nick Change] ---------------------------------------------------------------------------------------
    msg $chan $+ $nick has made a nick change. Previous $iif($gettok($gettok($read(%r,$readn),2,32),2,44),nicks have been,nick was) $sorttok($gettok($read(%r,$readn),2,32),44,c)
    echo $chan -----------------------------------------------------------------------------------------------------
    }
    Right?
  5. This code not working ,, whats the problem?!



    #nicktracker on

    on *:JOIN:#: exoclonecheck $nick $address $chan

    raw knock:*: exoclonecheck $nick $address $1


    alias exoclonecheck {

    if ($1 != $me) {

    ;If you want it to store more or less nicknames,

    ;change this number below to the number you want to store.

    var %n 4


    var %x $read($scriptdir $+ exoclonecheck.txt,sn,$2)

    if (%x == $null) write $+(",$scriptdir,exoclonecheck.txt") $2 $1

    else {

    %x = $addtok(%x,$1,32)

    if ($numtok(%x,32) > %n) %x = $deltok(%x,1,32)

    write -l $+ $readn $+(",$scriptdir,exoclonecheck.txt") $2 %x

    }

    if ($numtok(%x,32) > 1) msg # S \rTahoma;0 $5 $+ ( $+ $ecc.decode $1 $+ ) Last $+ $numtok(%x,32) Nicks Used :-( $+ $replace(%x,$chr(32),$chr(44) $+ $chr(32))) $+ )-

    elseif ((%x != $1) && (%x)) msg # S \rTahoma;0 $ecc.decode($1 $+ 's last name: %x)

    }

    }


    alias ecc.decode {

    if ($msn.vver) return $Buzz.ifdecode($1-)

    else return $1-

    }

    #nicktracker end


  6. Ok i try to modify the code and it is working 100% except one issue

    if the bot got banned , rejoin the room kick the person who bans with revenge

    but : The ban of the bot appears in Access how to clear it in the same following code

     

     

    #revenge on
    on *:KICK:#: {
    if ($nick == $me) || ($level($+(*!*, $Ial($nick).addr)) == level7) { halt }
    mode $me +q {
    access # add owner $ial($me).addr 0 : Rashed Script
    access # delete owner $address($nick,1)
    access # add deny $address($nick,1) 5 : Revenge
    kick $nick >>>>Revenge<<<<
    join $chan
    }
    }
  7. #revenge on

    on *:KICK:#: {

    if ($knick == $me) && ($nick != $me) && ($level($+(*!*, $Ial($nick).addr)) == level7) { halt }

    {

    join $chan

    access # add owner $Ial($me).addr 15

    access $chan delete owner $address($opnick,1)

    access # add deny $Ial($nick).addr 15 : Revenge

    .raw kick $chan $nick >>>>Revenge<<<<

    }

    }



    this code work for any kick if any op kick any one , the op got kicked then the bot kick itself

    whats the wrong


    I also want to check the access commands to work

    Note : Buzzen server

  8. I'm working for Buzzen script many codes of my old script doesn't work so i may need more help

     

    this is weather code dosent work

    i want it to work in buzzen and for all areas not only USA

     

     

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    ;;;;;; weather underground for mIRC ;;;;;;;;;;;;;;;;

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;by eqrunner ;;;;



    /*

    !w or !weather [zipcode|city,state|city,country|airport] will return current conditions.

    !forecast [zipcode|city,state|city,country|airport] will give detailed 3 day forecast (for us)

    !forecast5 [zipcode|city,state|city,country|airport] will send 5 day forecast to $nick that requested. (to prevent chan flooding)

    !alerts [zipcode|city,state|city,country|airport] will tell you if there are any weather alerts in your area.

    !alertinfo [zipcode|city,state|city,country|airport] will send $nick the detailed report of alerts in said area

    !time [zipcode|city,state|city,country|airport] will return current time.



    Notes from wunderground:

    We don't support old style abbreviations like Conn. for Connecticut, use CT

    If you are searching for an international city, try the name of the country or province

    Don't use provinces for non-us cities (ie: Vancouver, BC)

    Zipcodes only work in Canada, UK and the US

    */






    on $*:text:/^[!](w|weather|forecast|forecast5|alert|alerts|alertinfo|alertsinfo|time)/Si:#: {

    unset %wu_*

    if ($2 == $null) { .notice $nick Please specify a location $1 [zipcode|city,state|city,country|airport] | halt }

    set %wu_command $1

    set %wu_address $replace($2-,$chr(32),$chr(43))

    set %wu_nick $nick

    set %wu_network $network

    set %wu_chan $chan



    if (%wu_command == !weather) || (%wu_command == !w) || (%wu_command == !time) {

    set %wu_link $+(/auto/wui/geo/WXCurrentObXML/index.xml?query=,%wu_address)

    set %wu_host api.wunderground.com

    sockopen wunderground
    %wu_host 80

    }

    if (%wu_command == !forecast) || (%wu_command == !forecast5) {

    set %wu_link $+(/auto/wui/geo/ForecastXML/index.xml?query=,%wu_address)

    set %wu_host www.wunderground.com

    sockopen wunderground
    %wu_host 80



    }

    if (%wu_command == !alert) set %wu_command !alerts

    if (%wu_command == !alertsinfo) set %wu_command !alertinfo

    if (%wu_command == !alerts) || (%wu_command == !alertinfo) {

    ;echo -s pass

    set %wu_link $+(/auto/wui/geo/AlertsXML/index.xml?query=,%wu_address)

    set %wu_host www.wunderground.com

    sockopen wunderground
    %wu_host 80

    }



    ;echo -s LINK: %wu_link

    }





    on *:sockopen:wunderground: {



    ;sockwrite -n $sockname GET %wu_link XML/1.0

    sockwrite -n $sockname GET %wu_link

    sockwrite
    -n $sockname Host: %wu_host

    sockwrite
    -n $sockname $crlf

    }



    on *:sockread:wunderground: {

    sockread %wu_temp

    ;echo -s %wu_temp



    if (%wu_command == !weather) || (%wu_command == !w) || (%wu_command == !time) {

    ; local info

    if ( isin %wu_temp) && (%wu_full == $null) %wu_full = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) && (%wu_city == $null) %wu_city = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) && (%wu_state == $null) %wu_state = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) && (%wu_state_name == $null) %wu_state_name = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) && (%wu_country == $null) %wu_country = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) && (%wu_country_iso3166 == $null) %wu_country_iso3166 = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) && (%wu_zip == $null) %wu_zip = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) && (%wu_latitude == $null) %wu_latitude = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) && (%wu_longitude == $null) %wu_longitude = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) && (%wu_elevation == $null) %wu_elevation = $remove(%wu_temp,,,$chr(9))



    if ( isin %wu_temp) %wu_local_time = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) %wu_local_time_rfc822 = $remove(%wu_temp,,,$chr(9))



    ; current weather

    if ( isin %wu_temp) %wu_weather = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) %wu_temperature_string = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) %wu_temp_f = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) %wu_temp_c = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) %wu_relative_humidity = $remove(%wu_temp,,,$chr(9))



    ; wind

    if ( isin %wu_temp) %wu_wind_string = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) %wu_wind_dir = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) %wu_wind_degrees = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) %wu_wind_mph = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) %wu_wind_gust_mph = $remove(%wu_temp,,,$chr(9))



    if ( isin %wu_temp) %wu_pressure_string = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) %wu_pressure_mb = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) %wu_pressure_in = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) %wu_dewpoint_string = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) %wu_dewpoint_f = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) %wu_dewpoint_c = $remove(%wu_temp,,,$chr(9))



    if ( isin %wu_temp) %wu_heat_index_string = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) %wu_heat_index_f = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) %wu_heat_index_c = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) %wu_windchill_string = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) %wu_windchill_f = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) %wu_windchill_c = $remove(%wu_temp,,,$chr(9))



    if ( isin %wu_temp) %wu_visibility_mi = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) %wu_visibility_km = $remove(%wu_temp,,,$chr(9))

    }



    if (%wu_command == !forecast) || (%wu_command == !forecast5) {

    if ( isin %wu_temp) set %wu_period $remove(%wu_temp,,,$chr(9),$chr(32))

    if ( isin %wu_temp) set %wu_xtemp 1

    if ( isin %wu_temp) set %wu_xtemp 2

    if ( isin %wu_temp) set %wu_simpleforecast 1



    if ( isin %wu_temp) && (%wu_period == 1) %wu_f1_title = $remove(%wu_temp,,,$chr(9),$chr(32))

    if ( isin %wu_temp) && (%wu_period == 1) %wu_f1_fcttext = $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) && (%wu_period == 2) %wu_f2_title = $remove(%wu_temp,,,$chr(9),$chr(32))

    if ( isin %wu_temp) && (%wu_period == 2) %wu_f2_fcttext = $remove(%wu_temp,,,$chr(9))



    if (%wu_simpleforecast == 1) {

    if ( isin %wu_temp) set $+(%,wu_P,%wu_period,_weekday) $remove(%wu_temp,,,$chr(9),$chr(32))

    if ( isin %wu_temp) set $+(%,wu_P,%wu_period,_conditions) $remove(%wu_temp,,,$chr(9))

    if (%wu_xtemp == 1) {

    if ( isin %wu_temp) set $+(%,wu_P,%wu_period,_highf) $remove(%wu_temp,,,$chr(9),$chr(32))

    if ( isin %wu_temp) set $+(%,wu_P,%wu_period,_highc) $remove(%wu_temp,,,$chr(9),$chr(32))

    }

    if (%wu_xtemp == 2) {

    if ( isin %wu_temp) set $+(%,wu_P,%wu_period,_lowf) $remove(%wu_temp,,,$chr(9),$chr(32))

    if ( isin %wu_temp) set $+(%,wu_P,%wu_period,_lowc) $remove(%wu_temp,,,$chr(9),$chr(32))

    }

    }

    }

    if (%wu_command == !alerts) || (%wu_command == !alertinfo) {

    ;echo -s %wu_temp

    set -n %wu_ac <alert count="

    if (%wu_ac isin %wu_temp) set -n %wu_a_count $remove(%wu_temp,,,$chr(32),$chr(9))

    if ( isin %wu_temp) inc %wu_a_i

    if ( isin %wu_temp) set $+(%,wu_a,%wu_a_i,_type) $remove(%wu_temp,,,$chr(9))

    if ( isin %wu_temp) set $+(%,wu_a,%wu_a_i,_description) $remove(%wu_temp,,,$chr(9))

    if (<date epoch isin %wu_temp) set $+(%,wu_a,%wu_a_i,_date) $right($remove(%wu_temp,,,$chr(9)),-12)

    if (<expires epoch isin %wu_temp) set $+(%,wu_a,%wu_a_i,_expires) $right($remove(%wu_temp,,,$chr(9)),-10)

    if ( isin %wu_temp) { set %wu_msg OFF | set $+(%,wu_a,%wu_a_i,_count) $(%wu_msg_c,2) | set %wu_msg_c 0 }

    if (%wu_msg == ON) {

    inc %wu_msg_gc

    inc %wu_msg_c

    set $+(%,wu_a,%wu_a_i,_message,%wu_msg_c) %wu_temp

    }

    if ( isin %wu_temp) { set %wu_msg ON }

    }

    }







    on *:sockclose:wunderground: {

    var %wu_space = $+($chr(45),$chr(124),$chr(45))

    var %wu_spaceend = $+($chr(45),$chr(124))



    if (%wu_command == !weather) || (%wu_command == !w) {

    set %wu_present $remove(%wu_full,$chr(9),$chr(32),$chr(44))

    if (%wu_present == $null) msg %wu_chan Location not found

    if (%wu_present != $null) msg %wu_chan %wu_full $+ : %wu_weather and $+(%wu_temp_f,$chr(176),F,$chr(40),%wu_temp_c,$chr(176),C,$chr(41))

    }

    if (%wu_command == !time) {

    msg %wu_chan %wu_full $+ : %wu_local_time

    }

    if (%wu_command == !forecast) || (%wu_command == !forecast5) {

    if (%wu_f1_title != $null) {

    var %wu_forecast1 $(%wu_f1_title $+ : %wu_f1_fcttext)

    var %wu_forecast2 $(%wu_f2_title $+ : %wu_f2_fcttext)

    if (%wu_f2_title != %wu_P2_weekday ) var %wu_forecast3 $(%wu_P2_weekday $+ : %wu_P2_conditions $+ . High: $+(%wu_P2_highf,$chr(176),F) $chr(47) $+(%wu_P2_highc,$chr(176),C) Low: $+(%wu_P2_lowf,$chr(176),F) $chr(47) $+(%wu_P2_lowc,$chr(176),C))

    if (%wu_f2_title == %wu_P2_weekday ) var %wu_forecast3 $(%wu_P3_weekday $+ : %wu_P3_conditions $+ . High: $+(%wu_P3_highf,$chr(176),F) $chr(47) $+(%wu_P3_highc,$chr(176),C) Low: $+(%wu_P3_lowf,$chr(176),F) $chr(47) $+(%wu_P3_lowc,$chr(176),C))

    .timer 1 0 msg %wu_chan %wu_address $+ : %wu_forecast1

    .timer 1 1 msg %wu_chan %wu_forecast2 %wu_space %wu_forecast3 %wu_spaceend

    }

    if (%wu_f1_title == $null) {

    var %wu_forecast1 $(%wu_P1_weekday $+ : %wu_P1_conditions $+ . High: $+(%wu_P1_highf,$chr(176),F,$chr(40),%wu_P1_highc,$chr(176),C,$chr(41)) Low: $+(%wu_P1_lowf,$chr(176),F,$chr(40),%wu_P1_lowc,$chr(176),C,$chr(41)))

    var %wu_forecast2 $(%wu_P2_weekday $+ : %wu_P2_conditions $+ . High: $+(%wu_P2_highf,$chr(176),F,$chr(40),%wu_P2_highc,$chr(176),C,$chr(41)) Low: $+(%wu_P2_lowf,$chr(176),F,$chr(40),%wu_P2_lowc,$chr(176),C,$chr(41)))

    var %wu_forecast3 $(%wu_P3_weekday $+ : %wu_P3_conditions $+ . High: $+(%wu_P3_highf,$chr(176),F,$chr(40),%wu_P3_highc,$chr(176),C,$chr(41)) Low: $+(%wu_P3_lowf,$chr(176),F,$chr(40),%wu_P3_lowc,$chr(176),C,$chr(41)))

    .timer 1 0 msg %wu_chan %wu_address $+ : %wu_forecast1

    .timer 1 1 msg %wu_chan %wu_forecast2 %wu_space %wu_forecast3

    }

    }



    if (%wu_command == !forecast5) {

    ;.timer 1 0 .msg %wu_chan %wu_P1_weekday $+ : %wu_P1_conditions $+ . High: $+(%wu_P1_highf,$chr(176),F,$chr(40),%wu_P1_highc,$chr(176),C,$chr(41)) - Low: $+(%wu_P1_lowf,$chr(176),F,$chr(40),%wu_P1_lowc,$chr(176),C,$chr(41))

    .timer 1 1 .msg %wu_nick Your forcast for %wu_address

    .timer 1 2 .msg %wu_nick %wu_P1_weekday $+ : %wu_P1_conditions $+ . High: $+(%wu_P1_highf,$chr(176),F,$chr(40),%wu_P1_highc,$chr(176),C,$chr(41)) - Low: $+(%wu_P1_lowf,$chr(176),F,$chr(40),%wu_P1_lowc,$chr(176),C,$chr(41))

    .timer 1 3 .msg %wu_nick %wu_P2_weekday $+ : %wu_P2_conditions $+ . High: $+(%wu_P2_highf,$chr(176),F,$chr(40),%wu_P2_highc,$chr(176),C,$chr(41)) - Low: $+(%wu_P2_lowf,$chr(176),F,$chr(40),%wu_P2_lowc,$chr(176),C,$chr(41))

    .timer 1 4 .msg %wu_nick %wu_P3_weekday $+ : %wu_P3_conditions $+ . High: $+(%wu_P3_highf,$chr(176),F,$chr(40),%wu_P3_highc,$chr(176),C,$chr(41)) - Low: $+(%wu_P3_lowf,$chr(176),F,$chr(40),%wu_P3_lowc,$chr(176),C,$chr(41))

    .timer 1 5 .msg %wu_nick %wu_P4_weekday $+ : %wu_P4_conditions $+ . High: $+(%wu_P4_highf,$chr(176),F,$chr(40),%wu_P4_highc,$chr(176),C,$chr(41)) - Low: $+(%wu_P4_lowf,$chr(176),F,$chr(40),%wu_P4_lowc,$chr(176),C,$chr(41))

    .timer 1 6 .msg %wu_nick %wu_P5_weekday $+ : %wu_P5_conditions $+ . High: $+(%wu_P5_highf,$chr(176),F,$chr(40),%wu_P5_highc,$chr(176),C,$chr(41)) - Low: $+(%wu_P5_lowf,$chr(176),F,$chr(40),%wu_P5_lowc,$chr(176),C,$chr(41))

    .timer 1 7 .msg %wu_nick %wu_P6_weekday $+ : %wu_P6_conditions $+ . High: $+(%wu_P6_highf,$chr(176),F,$chr(40),%wu_P6_highc,$chr(176),C,$chr(41)) - Low: $+(%wu_P6_lowf,$chr(176),F,$chr(40),%wu_P6_lowc,$chr(176),C,$chr(41))

    }



    if (%wu_command == !alerts) {

    if (%wu_a_count == 0) msg %wu_chan %wu_address $+ : No Alerts

    if (%wu_a_count > 0) {

    msg %wu_chan %wu_address $+ : %wu_a_count Alerts

    var %i 1

    while (%i <= %wu_a_count) {

    .timer 1 %i msg %wu_chan %wu_a_start $($+(%,wu_a,%i,_description),2) till $($+(%,wu_a,%i,_expires),2) %wu_a_end

    inc %i

    }

    .timer 1 %i .notice %wu_nick use $chr(2) !alertinfo $chr(2) [zipcode|city,state|city,country|airport] for alert details

    }

    }

    if (%wu_command == !alertinfo) {

    if (%wu_a_count == 0) msg %wu_chan %wu_address $+ : No Alerts

    if (%wu_a_count > 0) {

    msg %wu_chan %wu_address $+ : %wu_a_count Alerts - See PM for details

    .msg %wu_nick %wu_address $+ : %wu_a_count Alerts

    var %i 1 , %i_gc 1

    while (%i <= %wu_a_count) {

    .timer 1 %i_gc .msg %wu_nick $chr(2) $($+(%,wu_a,%i,_description),2) $chr(2) from $($+(%,wu_a,%i,_date),2) till $($+(%,wu_a,%i,_expires),2)

    var %i_msg 1

    while (%i_msg <= $($+(%,wu_a,%i,_count),2)) {

    .timer 1 %i_gc .msg %wu_nick $($+(%,wu_a,%i,_message,%i_msg),2)

    inc %i_gc

    inc %i_msg

    }

    inc %i

    }

    .timer 1 %i_gc .msg %wu_nick --------- End of Alerts -------

    }

    }





    unset %wu_*

    ;echo -s End-------- of WU $time --------

    }

  9. this code for connect 4 game doesnt work (buzzen)

     

    ;Connect-4 Game
    ;;;;; Menu ;;;;;
    menu menubar {
    -
    Connect-4
    .Status
    ..On { /c4.start | c4info $chan (*) Connect-4 ON (*) | c4info $chan Type !c4play (nick) to play with nick :) }
    ..Off { /c4.stop | c4info $chan (*) Connect-4 OFF (*) }
    .Stop { /c4 off | msg (*) Connect-4 Stopped !! (*) }
    -
    }
    ;;;;;; Remotes ;;;;;;
    on level7:TEXT:@c4off:#:{ c4 off | /c4.stop | c4info $chan (*) Connect-4 Game is now Off }
    on level7:TEXT:@c4on:#:{ /c4.start | c4info $chan (*) Connect-4 Game is now On | c4info $chan Type !c4play (nick) to play with nick :) }
    on level7:TEXT:@c4stop:#:{ c4 off | c4info_err $chan connect-4 Stopped }
    ;;;;;; aliases ;;;;;;
    alias c4info { /msg $1 S Comic\bSans\bMS;0 $2- }
    alias c4info_err { /msg $1 S eComic\bSans\bMS;0 $2- }
    alias c4.init {
    %c4.turn = $r(1,2)
    %c4.times = 0
    %col.a = 0
    %col.b = 0
    %col.c = 0
    %col.d = 0
    %col.e = 0
    %col.f = 0
    %col.g = 0
    %c4.a.1 = (E)
    %c4.a.2 = (E)
    %c4.a.3 = (E)
    %c4.a.4 = (E)
    %c4.a.5 = (E)
    %c4.a.6 = (E)
    %c4.b.1 = (E)
    %c4.b.2 = (E)
    %c4.b.3 = (E)
    %c4.b.4 = (E)
    %c4.b.5 = (E)
    %c4.b.6 = (E)
    %c4.c.1 = (E)
    %c4.c.2 = (E)
    %c4.c.3 = (E)
    %c4.c.4 = (E)
    %c4.c.5 = (E)
    %c4.c.6 = (E)
    %c4.d.1 = (E)
    %c4.d.2 = (E)
    %c4.d.3 = (E)
    %c4.d.4 = (E)
    %c4.d.5 = (E)
    %c4.d.6 = (E)
    %c4.e.1 = (E)
    %c4.e.2 = (E)
    %c4.e.3 = (E)
    %c4.e.4 = (E)
    %c4.e.5 = (E)
    %c4.e.6 = (E)
    %c4.f.1 = (E)
    %c4.f.2 = (E)
    %c4.f.3 = (E)
    %c4.f.4 = (E)
    %c4.f.5 = (E)
    %c4.f.6 = (E)
    %c4.g.1 = (E)
    %c4.g.2 = (E)
    %c4.g.3 = (E)
    %c4.g.4 = (E)
    %c4.g.5 = (E)
    %c4.g.6 = (E)
    }
    alias c4.start {
    enable #c4
    set %c4.1 (*)
    set %c4.2 (S)
    %c4.sep = $chr(124)
    c4.init
    %hor = 

    }
    alias c4.stop {
    disable #c4
    unset %c4*
    }
    alias c4 {
    if ($1 == on) { set %c4.stat on }
    else { set %c4.stat off }
    }
    alias c4_stat { return c4.stat }
    alias showc4 {
    %c4.line = %hor %c4.sep %c4.a.6 %c4.sep %c4.b.6 %c4.sep %c4.c.6 %c4.sep %c4.d.6 %c4.sep %c4.e.6 %c4.sep %c4.f.6 %c4.sep %c4.g.6 %c4.sep %hor %c4.sep %c4.a.5 %c4.sep %c4.b.5 %c4.sep %c4.c.5 %c4.sep %c4.d.5 %c4.sep %c4.e.5 %c4.sep %c4.f.5 %c4.sep %c4.g.5 %c4.sep %hor %c4.sep %c4.a.4 %c4.sep %c4.b.4 %c4.sep %c4.c.4 %c4.sep %c4.d.4 %c4.sep %c4.e.4 %c4.sep %c4.f.4 %c4.sep %c4.g.4 %c4.sep %hor %c4.sep %c4.a.3 %c4.sep %c4.b.3 %c4.sep %c4.c.3 %c4.sep %c4.d.3 %c4.sep %c4.e.3 %c4.sep %c4.f.3 %c4.sep %c4.g.3 %c4.sep %hor %c4.sep %c4.a.2 %c4.sep %c4.b.2 %c4.sep %c4.c.2 %c4.sep %c4.d.2 %c4.sep %c4.e.2 %c4.sep %c4.f.2 %c4.sep %c4.g.2 %c4.sep %hor %c4.sep %c4.a.1 %c4.sep %c4.b.1 %c4.sep %c4.c.1 %c4.sep %c4.d.1 %c4.sep %c4.e.1 %c4.sep %c4.f.1 %c4.sep %c4.g.1 %c4.sep %hor player with (*) : %c4p.1 - player with (S) : %c4p.2 - Turn : %c4p. [ $+ [ %c4.turn ] ]
    msg $chan S Tahoma;0 %hor --[A]------[C]---[D]---[E]---[F]---[G]--
    msg $chan S Tahoma;0 %c4.line
    }
    alias checkplace {
    if (%col. [ $+ [ $1 ] ] == 6) { c4info_err $chan There's no place in column $upper($2) $nick !! | halt }
    elseif (%col. [ $+ [ $1 ] ] < 6) {
    inc %col. [ $+ [ $1 ] ]
    set %colnum %col. [ $+ [ $1 ] ]
    %c4. [ $+ [ $1 ] $+ . $+ [ %colnum ] ] = %c4. [ $+ [ %c4.turn ] ]
    %c4.place = $true
    }
    return %c4.place
    halt
    }
    alias c4.checknext {
    if ($checkwin(%c4. [ $+ [ %c4.turn ] ]) == $true) {
    showc4
    c4info $chan (*) %c4p. [ $+ [ %c4.turn ] ] won !! (*)
    c4 off
    halt
    }
    if (%c4.times == 42) {
    c4info $chan Drawn !! (N)
    c4 off
    halt
    }
    else {
    set %c4.turn $calc(3 - %c4.turn)
    showc4
    halt
    }
    }
    alias checkwin {
    %c4.win = $false
    %c4.winline = $str($1,4)
    if (%c4.a.6 $+ %c4.b.6 $+ %c4.c.6 $+ %c4.d.6 == %c4.winline) { %c4.win = $true }
    if (%c4.a.5 $+ %c4.b.5 $+ %c4.c.5 $+ %c4.d.5 == %c4.winline) { %c4.win = $true }
    if (%c4.a.4 $+ %c4.b.4 $+ %c4.c.4 $+ %c4.d.4 == %c4.winline) { %c4.win = $true }
    if (%c4.a.3 $+ %c4.b.3 $+ %c4.c.3 $+ %c4.d.3 == %c4.winline) { %c4.win = $true }
    if (%c4.a.2 $+ %c4.b.2 $+ %c4.c.2 $+ %c4.d.2 == %c4.winline) { %c4.win = $true }
    if (%c4.a.1 $+ %c4.b.1 $+ %c4.c.1 $+ %c4.d.1 == %c4.winline) { %c4.win = $true }
    if (%c4.b.6 $+ %c4.c.6 $+ %c4.d.6 $+ %c4.e.6 == %c4.winline) { %c4.win = $true }
    if (%c4.b.5 $+ %c4.c.5 $+ %c4.d.5 $+ %c4.e.5 == %c4.winline) { %c4.win = $true }
    if (%c4.b.4 $+ %c4.c.4 $+ %c4.d.4 $+ %c4.e.4 == %c4.winline) { %c4.win = $true }
    if (%c4.b.3 $+ %c4.c.3 $+ %c4.d.3 $+ %c4.e.3 == %c4.winline) { %c4.win = $true }
    if (%c4.b.2 $+ %c4.c.2 $+ %c4.d.2 $+ %c4.e.2 == %c4.winline) { %c4.win = $true }
    if (%c4.b.1 $+ %c4.c.1 $+ %c4.d.1 $+ %c4.e.1 == %c4.winline) { %c4.win = $true }
    if (%c4.c.6 $+ %c4.d.6 $+ %c4.e.6 $+ %c4.f.6 == %c4.winline) { %c4.win = $true }
    if (%c4.c.5 $+ %c4.d.5 $+ %c4.e.5 $+ %c4.f.5 == %c4.winline) { %c4.win = $true }
    if (%c4.c.4 $+ %c4.d.4 $+ %c4.e.4 $+ %c4.f.4 == %c4.winline) { %c4.win = $true }
    if (%c4.c.3 $+ %c4.d.3 $+ %c4.e.3 $+ %c4.f.3 == %c4.winline) { %c4.win = $true }
    if (%c4.c.2 $+ %c4.d.2 $+ %c4.e.2 $+ %c4.f.2 == %c4.winline) { %c4.win = $true }
    if (%c4.c.1 $+ %c4.d.1 $+ %c4.e.1 $+ %c4.f.1 == %c4.winline) { %c4.win = $true }
    if (%c4.d.6 $+ %c4.e.6 $+ %c4.f.6 $+ %c4.g.6 == %c4.winline) { %c4.win = $true }
    if (%c4.d.5 $+ %c4.e.5 $+ %c4.f.5 $+ %c4.g.5 == %c4.winline) { %c4.win = $true }
    if (%c4.d.4 $+ %c4.e.4 $+ %c4.f.4 $+ %c4.g.4 == %c4.winline) { %c4.win = $true }
    if (%c4.d.3 $+ %c4.e.3 $+ %c4.f.3 $+ %c4.g.3 == %c4.winline) { %c4.win = $true }
    if (%c4.d.2 $+ %c4.e.2 $+ %c4.f.2 $+ %c4.g.2 == %c4.winline) { %c4.win = $true }
    if (%c4.d.1 $+ %c4.e.1 $+ %c4.f.1 $+ %c4.g.1 == %c4.winline) { %c4.win = $true }
    if (%c4.a.1 $+ %c4.a.2 $+ %c4.a.3 $+ %c4.a.4 == %c4.winline) { %c4.win = $true }
    if (%c4.b.1 $+ %c4.b.2 $+ %c4.b.3 $+ %c4.b.4 == %c4.winline) { %c4.win = $true }
    if (%c4.c.1 $+ %c4.c.2 $+ %c4.c.3 $+ %c4.c.4 == %c4.winline) { %c4.win = $true }
    if (%c4.d.1 $+ %c4.d.2 $+ %c4.d.3 $+ %c4.d.4 == %c4.winline) { %c4.win = $true }
    if (%c4.e.1 $+ %c4.e.2 $+ %c4.e.3 $+ %c4.e.4 == %c4.winline) { %c4.win = $true }
    if (%c4.f.1 $+ %c4.f.2 $+ %c4.f.3 $+ %c4.f.4 == %c4.winline) { %c4.win = $true }
    if (%c4.g.1 $+ %c4.g.2 $+ %c4.g.3 $+ %c4.g.4 == %c4.winline) { %c4.win = $true }
    if (%c4.a.2 $+ %c4.a.3 $+ %c4.a.4 $+ %c4.a.5 == %c4.winline) { %c4.win = $true }
    if (%c4.b.2 $+ %c4.b.3 $+ %c4.b.4 $+ %c4.b.5 == %c4.winline) { %c4.win = $true }
    if (%c4.c.2 $+ %c4.c.3 $+ %c4.c.4 $+ %c4.c.5 == %c4.winline) { %c4.win = $true }
    if (%c4.d.2 $+ %c4.d.3 $+ %c4.d.4 $+ %c4.d.5 == %c4.winline) { %c4.win = $true }
    if (%c4.e.2 $+ %c4.e.3 $+ %c4.e.4 $+ %c4.e.5 == %c4.winline) { %c4.win = $true }
    if (%c4.f.2 $+ %c4.f.3 $+ %c4.f.4 $+ %c4.f.5 == %c4.winline) { %c4.win = $true }
    if (%c4.g.2 $+ %c4.g.3 $+ %c4.g.4 $+ %c4.g.5 == %c4.winline) { %c4.win = $true }
    if (%c4.a.3 $+ %c4.a.4 $+ %c4.a.5 $+ %c4.a.6 == %c4.winline) { %c4.win = $true }
    if (%c4.b.3 $+ %c4.b.4 $+ %c4.b.5 $+ %c4.b.6 == %c4.winline) { %c4.win = $true }
    if (%c4.c.3 $+ %c4.c.4 $+ %c4.c.5 $+ %c4.c.6 == %c4.winline) { %c4.win = $true }
    if (%c4.d.3 $+ %c4.d.4 $+ %c4.d.5 $+ %c4.d.6 == %c4.winline) { %c4.win = $true }
    if (%c4.e.3 $+ %c4.e.4 $+ %c4.e.5 $+ %c4.e.6 == %c4.winline) { %c4.win = $true }
    if (%c4.f.3 $+ %c4.f.4 $+ %c4.f.5 $+ %c4.f.6 == %c4.winline) { %c4.win = $true }
    if (%c4.g.3 $+ %c4.g.4 $+ %c4.g.5 $+ %c4.g.6 == %c4.winline) { %c4.win = $true }
    if (%c4.a.1 $+ %c4.b.2 $+ %c4.c.3 $+ %c4.d.4 == %c4.winline) { %c4.win = $true }
    if (%c4.a.2 $+ %c4.b.3 $+ %c4.c.4 $+ %c4.d.5 == %c4.winline) { %c4.win = $true }
    if (%c4.a.3 $+ %c4.b.4 $+ %c4.c.5 $+ %c4.d.6 == %c4.winline) { %c4.win = $true }
    if (%c4.b.1 $+ %c4.c.2 $+ %c4.d.3 $+ %c4.e.4 == %c4.winline) { %c4.win = $true }
    if (%c4.b.2 $+ %c4.c.3 $+ %c4.d.4 $+ %c4.e.5 == %c4.winline) { %c4.win = $true }
    if (%c4.b.3 $+ %c4.c.4 $+ %c4.d.5 $+ %c4.e.6 == %c4.winline) { %c4.win = $true }
    if (%c4.c.1 $+ %c4.d.2 $+ %c4.e.3 $+ %c4.f.4 == %c4.winline) { %c4.win = $true }
    if (%c4.c.2 $+ %c4.d.3 $+ %c4.e.4 $+ %c4.f.5 == %c4.winline) { %c4.win = $true }
    if (%c4.c.3 $+ %c4.d.4 $+ %c4.e.5 $+ %c4.f.6 == %c4.winline) { %c4.win = $true }
    if (%c4.d.1 $+ %c4.e.2 $+ %c4.f.3 $+ %c4.g.4 == %c4.winline) { %c4.win = $true }
    if (%c4.d.2 $+ %c4.e.3 $+ %c4.f.4 $+ %c4.g.5 == %c4.winline) { %c4.win = $true }
    if (%c4.d.3 $+ %c4.e.4 $+ %c4.f.5 $+ %c4.g.6 == %c4.winline) { %c4.win = $true }
    if (%c4.a.4 $+ %c4.b.3 $+ %c4.c.2 $+ %c4.d.1 == %c4.winline) { %c4.win = $true }
    if (%c4.a.5 $+ %c4.b.4 $+ %c4.c.3 $+ %c4.d.2 == %c4.winline) { %c4.win = $true }
    if (%c4.a.6 $+ %c4.b.5 $+ %c4.c.4 $+ %c4.d.3 == %c4.winline) { %c4.win = $true }
    if (%c4.b.4 $+ %c4.c.3 $+ %c4.d.2 $+ %c4.e.1 == %c4.winline) { %c4.win = $true }
    if (%c4.b.5 $+ %c4.c.4 $+ %c4.d.3 $+ %c4.e.2 == %c4.winline) { %c4.win = $true }
    if (%c4.b.6 $+ %c4.c.5 $+ %c4.d.4 $+ %c4.e.3 == %c4.winline) { %c4.win = $true }
    if (%c4.c.4 $+ %c4.d.3 $+ %c4.e.2 $+ %c4.f.1 == %c4.winline) { %c4.win = $true }
    if (%c4.c.5 $+ %c4.d.4 $+ %c4.e.3 $+ %c4.f.2 == %c4.winline) { %c4.win = $true }
    if (%c4.c.6 $+ %c4.d.5 $+ %c4.e.4 $+ %c4.f.3 == %c4.winline) { %c4.win = $true }
    if (%c4.d.4 $+ %c4.e.3 $+ %c4.f.2 $+ %c4.g.1 == %c4.winline) { %c4.win = $true }
    if (%c4.d.5 $+ %c4.e.4 $+ %c4.f.3 $+ %c4.g.2 == %c4.winline) { %c4.win = $true }
    if (%c4.d.6 $+ %c4.e.5 $+ %c4.f.4 $+ %c4.g.3 == %c4.winline) { %c4.win = $true }
    return %c4.win
    }
    ;;;; Code ;;;;
    #c4 off
    on *:TEXT:!opt:#:{
    ctcpreply $nick TIME -=((*))[ Connect-4 Options ]((*))=-
    ctcpreply $nick TIME Type !c4play nick to start game with nick
    ctcpreply $nick TIME Type !stop to end the game
    ctcpreply $nick TIME Type !credit to show the Credits for Connect-4
    ctcpreply $nick TIME Type !rules to show Rules of Connect-4
    }
    on *:TEXT:!stop:#:{
    if ($nick !isop #) { c4info_err $chan Only Owners, hosts, or player can stop the game $nick | halt }
    }
    on *:TEXT:!credit:#:{
    ctcpreply $nick TIME -=((*))[ Connect-4 Game for Mirc (Version 1) ]((*))=-
    ctcpreply $nick TIME Released : Sun. Jan, 1st 2006
    ctcpreply $nick TIME Created By : St-Obnoxious
    }
    on *:TEXT:!rules:#:{
    ctcpreply $nick TIME -=((*))[ Connect-4 Rules ]((*))=-
    ctcpreply $nick TIME Connect-4 is a four-in-a-row variation of Tic-tac-toe.
    ctcpreply $nick TIME On each turn you drop one piece down any column that is not already filled.
    ctcpreply $nick TIME Drop the piece by typing !p then colum letter (A, B, C, D, F, or G) (ex: !p a)
    ctcpreply $nick TIME Any piece you drop will drop to the lowest available spaces in the columns.
    ctcpreply $nick TIME The winner is the first to get four in a row (any direction, including diagonals).
    }
    on *:TEXT:!c4play *:#:{
    if (%c4.stat == on) { c4info_err $chan There's a game started .. Please wait that one to finish | halt }
    if (!$2) { c4info_err $chan You have to choose an opponent $nick ! | halt }
    if ($2 == $nick) { c4info_err $chan You can't challange yourself $nick ! | halt }
    if ($2 !ison $chan) { c4info_err $chan Can't find $2 ! | halt }
    if ($2 == $me) { c4info_err $chan Not me !! try another one :) | halt }
    c4info $chan $nick starts a Connect-4 Game with $2 :)
    c4info $chan Type \\ $+ !opt $+ // to show your commands !
    set %c4p.1 $nick
    set %c4p.2 $2
    c4.init
    c4 on
    showc4
    }
    on *:TEXT:!p*:#:{
    if ($nick != %c4p.1) && ($nick != %c4p.2) { c4info_err $chan You're not a player in this game $nick ! | halt }
    if ($2 != $chr(97)) && ($2 != $chr(98)) && ($2 != $chr(99)) && ($2 != $chr(100)) && ($2 != $chr(101)) && ($2 != $chr(102)) && ($2 != $chr(103)) { c4info_err $chan Invalid Column !! | halt }
    if ($nick == %c4p.1) && (%c4.turn != 1) { c4info_err $chan It's not your turn $nick ! | halt }
    if ($nick == %c4p.2) && (%c4.turn != 2) { c4info_err $chan It's not your turn $nick ! | halt }
    if ($checkplace($2) == $true) {
    inc %c4.times
    c4.checknext
    }
    }
    on *:KICK:#:{
    if ($knick == %c4p.1) || ($knick == %c4p.2) {
    c4 off
    c4info_err $chan Connect-4 Stopped due to kicking of $knick
    }
    }
    on *:PART:#:{
    if ($nick == %c4p.1) || ($nick == %c4p.2) {
    c4 off
    c4info_err $chan Connect-4 Stopped due to leaving of $nick
    }
    }
    on *:JOIN:#:{ ctcpreply $nick TIME Check our new game (*)Connect-4(*) by typing !opt :) }
    #c4 end
×
×
  • Create New...