| View previous topic :: View next topic ? |
| Author |
Message |
sweepy
Joined: 14 Mar 2005
Posts: 6
|
Posted: Mon Mar 14, 2005 3:07 am?? ?Post subject: need help whit .ini script
|
 |
|
Hi i have a script that allows people to type the trigger and get there own account whit my ftp
here is the script i use
on *:TEXT:!trigger:#hidden: {
if (%ftp == on) { .notice $nick <> ftp:// $+ $nick $+ :"thepassword"@"server.adress:port" <> Dont have an account use !gimmi in #hidden <> }
if (%ftp == off) { .notice $nick FTP down - sweeper.serveftp.org }
else { }
}
on *:TEXT:!make-acc:#hidden: { copy "C:ftp\users\main.ini" "C:\ftp\users\ $+ $nick $+ .ini"
.notice $nick <> Account created: ftp:// $+ $nick $+ :"thepassword"@"server.adress:port"<>
.msg sweeper $nick har laget en ny konto
}
the thing i want is when people type !make-acc it also edit's the new ini file so people get there own pass (from a list or like !make-acc "pass")
here is the contect of a standard .ini file for my ftp server
[Account]
AccessList0=/,E:\FTP,R---,FD--I---
CreationDate=2005/03/04 19:35:10
Enabled=-1
PasswordEnabled=-1
ExpirationDate=2005/03/10
IncomingFXPAllowed=-1
LogEnabled=-1
OutgoingFXPAllowed=-1
Password=:access
QuotaCheckOnLogin=-1
is there a way to "edit line after Password=:"
what i need is like thay type the trigger !make-acc "pass"
so when they make the account in the first pase thay make there own pass too
plz help
|
|
| Back to top |
|
|
mite
Joined: 30 Oct 2004
Posts: 107
|
Posted: Mon Mar 14, 2005 4:24 am?? ?Post subject:
|
 |
|
You caught me on a boring Sunday evening with the desire to code, so I've created something for you.
This should allow users to make an account by typing either '!make-acc' or '!make-acc password'. It does this by using /write -l10 which writes to the 10th line of the file (the line containing the pw)
It will also print all accounts created to an @Window which is logged as @ftp.echo.txt in your ftp directory
Just load the script, edit the settings accordingly, and then restart mIRC. The script does a few things on the start event.
Let me know if you have any problems or questions about it.. I didn't get a chance to test it out a whole lot after I wrote it.
You may want to check out http://mircscripts.org/ for helpful tutorials and code snippets. Also, #mIRC on various networks and #mircscripting on Undernet are good places to get mIRC scripting help on IRC.
| Code: |
alias ftp.loadsettings {
? ; Settings
? set %ftp on
? set %ftp.defaultpass access
? set %ftp.server sweeper.serveftp.org
? set %ftp.port 21
? set %ftp.channel #hidden
? set %ftp.directory C:\ftp\users\
? set %ftp.trigger !trigger
? set %ftp.trigger.account !make-acc
? ; /Settings
}
on *:start:{
? ftp.loadsettings
? window -e @ftp.echo
? log on @ftp.echo -f %ftp.directory $+ @ftp.echo.txt
}
on *:text:$(%ftp.trigger):%ftp.channel: {
? if (%ftp == on) {
? ? .notice $nick <> ftp:// $+ $nick $+ :password@ $+ %ftp.server $+ : $+ %ftp.port $+ / <> Dont have an account? Use %ftp.trigger.account in %ftp.channel <>
? }
? elseif (%ftp == off) {
? ? .notice $nick <> FTP down - %ftp.server - %ftp.channel <>
? }
}
on *:text:$(%ftp.trigger.account $+ *):%ftp.channel: {
? copy %ftp.directory $+ main.ini %ftp.directory $+ $nick $+ .ini
? .write -l10 %ftp.directory $+ $nick $+ .ini Password=: $+ $iif($2,$2,%ftp.defaultpass)
? .notice $nick <> Account created: ftp:// $+ $nick $+ : $+ $iif($2,$2,%ftp.defaultpass) $+ @ $+ %ftp.server $+ : $+ %ftp.port $+ / <>
? ftp.echo <> Account created: ftp:// $+ $nick $+ : $+ $iif($2,$2,%ftp.defaultpass) $+ @ $+ %ftp.server $+ : $+ %ftp.port $+ / <>
}
alias ftp.echo {
? if ($window(@ftp.echo) {
? ? aline -p @ftp.echo $+ $asctime $+ $1-
? }
? else {
? ? echo -ts $+ $asctime $+ $1-
? }
}
|
|
|
| Back to top |
|
|
sweepy
Joined: 14 Mar 2005
Posts: 6
|
Posted: Tue Mar 15, 2005 1:23 am?? ?Post subject: thx dude
|
 |
|
if you have the time can u help me whit one more thing when people type the
!trigger they get lsomthing like ftp://Evil_duke:password@jallajalla.com
how can i make the script look in the ini file and find the pass so it can show them there pass in sted off the txt password
|
|
| Back to top |
|
|
mite
Joined: 30 Oct 2004
Posts: 107
|
Posted: Tue Mar 15, 2005 11:21 am?? ?Post subject:
|
 |
|
change line 29 to this:
| Code: |
| .notice $nick <> ftp:// $+ $nick $+ : $+ $gettok($read(%ftp.directory $+ $nick $+ .ini,10),58,2-) $+ @ $+ %ftp.server $+ : $+ %ftp.port $+ / <> Dont have an account? Use %ftp.trigger.account in %ftp.channel <> |
|
|
| Back to top |
|
|
sweepy
Joined: 14 Mar 2005
Posts: 6
|
Posted: Tue Mar 15, 2005 1:33 pm?? ?Post subject:
|
 |
|
thx
'
|
|
| Back to top |
|
|
Yochai
Joined: 31 Mar 2005
Posts: 5
|
Posted: Thu Mar 31, 2005 2:10 pm?? ?Post subject:
|
 |
|
| Quote: |
| Code: |
| notice $nick <> ftp:// $+ $nick $+ : $+ $gettok($read(%ftp.directory $+ $nick $+ .ini,10),58,2-) $+ @ $+ %ftp.server $+ : $+ %ftp.port $+ / <> Dont have an account? Use %ftp.trigger.account in %ftp.channel <> |
|
Ah, why do it so messy ?
one $+ is enough...
This looks much better:
| Code: |
.notice $nick <> $+(ftp://,$nick,:,$gettok($read(%ftp.directory,$nick,.ini,10),58,2-),@,%ftp.server,:,%ftp.port,/) <> Dont have an account? Use %ftp.trigger.account in %ftp.channel <> |
_________________
#mirc
Undernet
|
|
| Back to top |
|
|
mite
Joined: 30 Oct 2004
Posts: 107
|
Posted: Fri Apr 01, 2005 5:50 am?? ?Post subject:
|
 |
|
|
cool.
|
|
| Back to top |
|
|
|
|
?
|
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
|
Powered by phpBB ? 2001, 2002 phpBB Group
Free Advertising | Xbox Mod Chip | Mortgages | The eBay Song | Music instruments
|