mIRC Home    About    Download    Register    News    Help

Print Thread
#182080 04/08/07 09:26 AM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
I use this code:
Code:
alias aoplist {
  dialog -m auto-op auto-op
}
dialog auto-op {
  title ""
  size -1 -1 200 95
  option dbu
  button "&Close", 1, 155 60 40 10, ok

  list 2, 0 15 150 66, sort vsbar hsbar size
  edit "", 3, 0 2 150 10, autohs
  button "&Update", 4, 155 20 40 10
  button "&Delete", 5, 155 40 40 10
}
on *:dialog:auto-op:*:*: {
  if ($devent == init) {
    unset %tmp.aop
    list.aop
    dialog -t $dname            Current added auto-op hosts: $aop(0)
  }
  if ($devent == sclick) {
    if ($did == 2) { did -ra $dname 3 $did(2,$did(2).sel) | set %tmp.aop $did(2,$did(2).sel) }
    if ($did == 4) { if (%tmp.aop != $null) { .aop $remove(%tmp.aop,$chr(40),$chr(41)) | list.aop } }
    if ($did == 5) { if (%tmp.aop != $null) { .aop -r $remove(%tmp.aop,$chr(40),$chr(41)) | .ruser 500 $regsubex(%tmp.aop,\(.*\),$null) | list.aop } }
  }
  if ($devent == edit) {
    if ($did == 3) { set %tmp.aop $did(3).text }  
  }
}
alias list.aop {
  dialog -t auto-op            Current added auto-op hosts: $aop(0)
  did -r auto-op 2,3
  if ($aop(0) == 0) { did -a auto-op 2 No user hosts added to auto-op list. | return }
  var %x = 1
  while (%x <= $aop(0)) {
    did -az auto-op 2 $aop(%x) ( $+ $aop(%x).type $+ )
    inc %x
    unset %tmp.aop
  }
}

It working fine for me, but have one problem, thats when i edit the channels on the auto-op list for a user, add a channel is no problem, but when i want to remove a channel i get a problem, the %tmp.aop is set as it should, how ever the channel arent removed from the aop list, and i don't know how to solve it, i guess i do something wrong and don't think clear on this one, someone that can point me in the right direction. And explain a bit about how it's done if you have the time. thnx


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
I was thinking that maybe more info will help on this one.



I want to use a while loop true all hosts in my aop list, but im not able to solve this, the problem i have is when i want to remove a channel from a user, then i erase the channel in the dialog ID 3 , it will set the varialble "%tmp.aop" and it will look like:

*!*test@*.test.com (#test,#testing)

and then i erase the channel #test, that leavs me
with the variable looking like:

*!*test@*.test.com (#testing)

The problem i have is to compare the aop list with the %var and then match the host, and if one channel are removed i want to update the aop list so the channel i erased should be removed from the aop list, i only got it so i can add a channel to the %var, then pressing Update will add the channel to the user host in the list.

someone that can show me how it's done and explain what it does?

the code i use is this one:
Code:
alias aoplist {
  dialog -m auto-op auto-op
}
dialog auto-op {
  title ""
  size -1 -1 200 95
  option dbu
  button "&Close", 1, 155 60 40 10, ok
 
  list 2, 0 15 150 66, sort vsbar hsbar size
  edit "", 3, 0 2 150 10, autohs
  button "&Update", 4, 155 20 40 10
  button "&Delete", 5, 155 40 40 10
}
on *:dialog:auto-op:*:*: {
  if ($devent == init) {
    unset %tmp.aop
    list.aop
    dialog -t $dname            Current added auto-op hosts: $aop(0)
  }
  if ($devent == sclick) {
    if ($did == 2) { did -ra $dname 3 $did(2,$did(2).sel) | set %tmp.aop $did(2,$did(2).sel) }
    if ($did == 4) { if (%tmp.aop != $null) { .aop $remove(%tmp.aop,$chr(40),$chr(41)) | list.aop } }
    if ($did == 5) { if (%tmp.aop != $null) { .aop -r $remove(%tmp.aop,$chr(40),$chr(41)) | .ruser 500 $regsubex(%tmp.aop,\(.*\),$null) | list.aop } }
  }
  if ($devent == edit) {
    if ($did == 3) { set %tmp.aop $did(3).text }  
  }
}
alias list.aop {
  dialog -t auto-op            Current added auto-op hosts: $aop(0)
  did -r auto-op 2,3
  if ($aop(0) == 0) { did -a auto-op 2 No user hosts added to auto-op list. | return }
  var %x = 1
  while (%x <= $aop(0)) {
    did -az auto-op 2 $aop(%x) ( $+ $aop(%x).type $+ )
    inc %x
    unset %tmp.aop
  }
}


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Try using $remtok to remove the channel from the variable.

Little example on how it works:

/set %Chans #Hello #This #World

A variable storing 3 channel names.

//echo -a $remtok(%chans,#This,32)

Using $remtok we are removing #This from the variable, which now returns #Hello World

Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
And how would that be done? since i remove the channel from the %var, then it's nothing to let mirc know what i just removed, tryed to do a while loop true the auto-op list, but didn't have any luck with it, also tryed to set two %var's with same values, then only edit one of them and make a match, still no go on the problem. the only thing that happened what the channel i wanted to remove was the only one left, and that wasn't what i was trying to do..


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
I haven't tried your code in any way, I just used $remtok as an example to remove a certain channel from the variable. But you should also note 32 is for spaces, so you will need to change that to 44 for comma's if you haven't done so already.

Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
I tested to use 44 befor, i have been trying everything i can think of, also asked people in a script channel, got one "example" that didnt work so couldent read and figure out how to do it with that code, so im totaly stuck here, been trying for two days now to solve it without any luck.. smirk


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Ok I just used your code and it does seem to be working because I'm echoing the results it just doesn't seem to want to update.

I'm not sure how /aop works as I've never used it but it seems it wont let you remove the channels, it's only letting me add. I've got an address with 3 channels and when I try to update it with only 2 channels it remains with 3. Maybe try deleting the address then readding it with the channels.

Code:
    if ($did == 4) { if (%tmp.aop != $null) { .aop -r $gettok($remove(%tmp.aop,$chr(40),$chr(41)),1,32) | aop $remove(%tmp.aop,$chr(40),$chr(41)) | list.aop } }

Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Thnx for your help, i solved it this way:

if ($did == 4) { if (%tmp.aop != $null) { .aop -rw $regsubex(%tmp.aop,\(.*\),$null) | .aop $remove(%tmp.aop,$chr(40),$chr(41)) | list.aop } }

A bit messy i know, but it working as i want it to smile


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Mar 2007
Posts: 218
V
Fjord artisan
Offline
Fjord artisan
V
Joined: Mar 2007
Posts: 218
i'm sick of seeing posts of yours like this.
You seem to paste 6 millions lines of someone elses code, then because something doesn't work, you want people on here to give you the answers.
The when decent people decide to help (not sure why anymore)
The bottom post always says the same "Thnx for your help, i solved it this way"
This is getting rediculous, i don't think you're writing any of this yourself, otherwise you'd know what's wrong, or there wouldn't be anything wrong with it in the first place.
It's just stupid. mad

Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Originally Posted By: vexed2
i'm sick of seeing posts of yours like this.
You seem to paste 6 millions lines of someone elses code, then because something doesn't work, you want people on here to give you the answers.
The when decent people decide to help (not sure why anymore)
The bottom post always says the same "Thnx for your help, i solved it this way"
This is getting rediculous, i don't think you're writing any of this yourself, otherwise you'd know what's wrong, or there wouldn't be anything wrong with it in the first place.
It's just stupid. mad

If i didnt write anything of it my self, then why should i ask here for help? then the person that wrote the rest of the code could write the rest too ? so yes i wrote it my self, and as i said in this question "someone that can point me in the right direction. And explain a bit about how it's done if you have the time. thnx", that means i had no clue on how to grab the info and then return the value i needed, how ever i saw what sladekraven wrote:

if ($did == 4) { if (%tmp.aop != $null) { .aop -r $gettok($remove(%tmp.aop,$chr(40),$chr(41)),1,32) | aop $remove(%tmp.aop,$chr(40),$chr(41)) | list.aop } }

and then i started to think of that i could completly remove the old value and replace it with the new one, a thing i didnt think of befor, so stop flame about someone else wrote it, the only thing someone else helped me with in this code, it's that he told me to use mirc's own /aop system instead of write my own, and that was my first idea but had problem make it work as it should with op people for just 1 channel or give them op if i added more channels to them.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Mar 2007
Posts: 218
V
Fjord artisan
Offline
Fjord artisan
V
Joined: Mar 2007
Posts: 218
Every single one of your posts is the same.
Hixxy was right when he said he wasn't going to help you anymore.
You don't learn, that's because i strongly believe none of it is your code.
As for saying if it's not yours, why do you ask for help here, There are posts everyday with other peoples code.
You have 2000+ posts which most are asking questions about your 'so called code' you should recognise your own mistakes or how to get round something by now if you're the one writing it
if you learnt anything from these 2000+ posts you wouldn't be back so frequent asking dumb questions.
I'm sick of seeing it day after day.

Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
then don't look, no one asking YOU to be the one that help all peoples here, simply just turn of your computer and you don't need to be so frustrated. simple, and problem solved!


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Mar 2007
Posts: 218
V
Fjord artisan
Offline
Fjord artisan
V
Joined: Mar 2007
Posts: 218
Do us all a favour, and help yourself.
Stop posting pathetic questions about code you obviously know nothing about, and then come up with a regular expression answer to it out of no where, if you can manage that you can manage to stop posting stupid questions.
nuff said. eof.

Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Originally Posted By: vexed2
Do us all a favour, and help yourself.
Stop posting pathetic questions about code you obviously know nothing about, and then come up with a regular expression answer to it out of no where, if you can manage that you can manage to stop posting stupid questions.
nuff said. eof.

So when you can't come up with a answer, then you start call questions patetic ? if questions are patetic, how come you are here then? and that was totaly new to me, never even used mirc's own auto lists, not aop or avoice, so then i need to ask since i haven't a clue on how they working, but now i start to understand them, and that thanx to my "patetic" questions about it.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Mar 2007
Posts: 218
V
Fjord artisan
Offline
Fjord artisan
V
Joined: Mar 2007
Posts: 218
This is proof in the pudding..
here
The above post was a waste of bandwidth.
here
Funny you're experimenting with $gettok in the above postwhistle





Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
yes, trying to lern it, how did you learn? or you did know how it worked from the start ? i lern by try it, then get people to explain if i dont understand it


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Mar 2007
Posts: 218
V
Fjord artisan
Offline
Fjord artisan
V
Joined: Mar 2007
Posts: 218
I used /help and a few posts here.
Not 2000+ posts then ask how to get a number to return in megabytes. sheesh


Link Copied to Clipboard