;------------------------; ; Soldat Clicker Script ; ; By ramirez ; ;------------------------; on *:LOAD:SoldatSetPath on ^*:HOTLINK:soldat*:*:{ var %soldat_hotlink_regex, %soldat_hotlink_match %soldat_hotlink_regex = /^soldat:\/\/([\w-.]+)(:(\d+))?(\/([^\/]+))?\/?$/i %soldat_hotlink_match = $regex(soldat_hotlink, $strip($1), %soldat_hotlink_regex) if (%soldat_hotlink_match) { return } else { halt } } on *:HOTLINK:soldat*:*:{ var %soldat_address = $regml(soldat_hotlink, 1), %soldat_port = 23073, %soldat_password = $null if (!$isfile(%soldat_executable)) { SoldatSetPath } if ($isfile(%soldat_executable)) { if ($regml(soldat_hotlink, 0) == 3) { if ($left($regml(soldat_hotlink, 2), 1) == :) { %soldat_port = $regml(soldat_hotlink, 3) } else { %soldat_password = $regml(soldat_hotlink, 3) } } elseif ($regml(soldat_hotlink, 0) == 5) { %soldat_port = $regml(soldat_hotlink, 3) %soldat_password = $regml(soldat_hotlink, 5) } run $+(", %soldat_executable, ") -join %soldat_address %soldat_port %soldat_password } else { echo 4 -a The path  $+ %soldat_executable $+  is not valid executable. } } alias -l SoldatSetPath { var %path, %dir, %full_path if ($isdir($nofile(%soldat_executable))) { %dir = $nofile(%soldat_executable) } else { %dir = $mircdir } %path = $sdir(%dir, Path to Soldat Directory) if ($isdir(%path)) { %full_path = %path $+ Soldat.exe if (!$isfile(%full_path)) { if ($?!="File %full_path does not exist. $crlf $+ If your Soldat executable is named differently, choose 'Yes' to select the file manually.") { %full_path = $sfile(%path, Soldat Executable) if ($isfile(%full_path)) { set %soldat_executable %full_path } } } else { set %soldat_executable %full_path } } } alias -l SoldatProfSubMenu { var %name, %default, %profile_default, %i if ($1 isnum) { %default = $nofile(%soldat_executable) $+ soldat.ini if (!$isfile(%default)) return $null %i = $calc($1 - 1) if (%i == 0) %name = Default else %name = $left($nopath($findfile($nofile(%soldat_executable) $+ Profiles, *.ini, %i)), -4) if (%name) { %profile_default = $readini(%default, GAME, Profile_Default) return $iif(%profile_default == %i, $style(1)) %name $+ :SoldatSetProf %i } } } alias -l SoldatSetProf { var %default = $nofile(%soldat_executable) $+ soldat.ini if ($1 isnum && $isfile(%default)) { writeini $+(", %default, ") GAME Profile_Default $1 flushini $+(", %default, ") } } alias -l SoldatSwitchSpec { var %profile, %profsetting, %specsetting, %default = $nofile(%soldat_executable) $+ soldat.ini if ($isfile(%default)) { %profsetting = $readini(%default, GAME, Profile_Default) if (%profsetting == 0) %profile = $nofile(%soldat_executable) $+ soldat.ini else %profile = $findfile($nofile(%soldat_executable) $+ Profiles, *.ini, %profsetting) if ($isfile(%profile)) { %specsetting = $readini(%profile, NETWORK, Spectator) if (%specsetting != $null) { writeini $+(", %profile, ") NETWORK Spectator $iif(%specsetting == 0, 1, 0) flushini $+(", %profile, ") } } } } alias -l SoldatGetSpec { var %profile, %profsetting, %specsetting, %default = $nofile(%soldat_executable) $+ soldat.ini if ($isfile(%default)) { %profsetting = $readini(%default, GAME, Profile_Default) if (%profsetting == 0) %profile = $nofile(%soldat_executable) $+ soldat.ini else %profile = $findfile($nofile(%soldat_executable) $+ Profiles, *.ini, %profsetting) if ($isfile(%profile)) { %specsetting = $readini(%profile, NETWORK, Spectator) if (%specsetting == 1) return $true } } return $false } menu status,channel,query,menubar,nicklist { Soldat .Set Path to Soldat:SoldatSetPath .- .Switch Profile ..$submenu($SoldatProfSubMenu($1)) .$iif($SoldatGetSpec, $style(1)) Join as Spectator:SoldatSwitchSpec }