Greet *Unfinished*

By Crissar on Mar 05, 2009

Well since the last snippets i posted actualy got lold @ , i thought of trying to write my own code and posting it here......

Simply using variables this script adds an on join/greet msg.

Use :
Right Click

UPDATE
Dialog from Duelist helped alot.It is and yes i know it...fked up abit with the sclick etc...but lemme get ahold of the studio 1st....if i may ^^
//UPDATE//

on !*:join:#:{
  if (%hi. [ $+ [ $nick ] ] != $null) {
    msg $chan $+([,$nick,]) %hi. [ $+ [ $nick ] ]
  }
}

menu nicklist,channel,query,menubar {
  .Greets: { dialog -m greets greets }
}
dialog greets {
  title "Greets"
  size -1 -1 200 111
  option dbu
  text "List of nicks owning a greet", 1, 1 1 90 10
  list 2, 1 11 98 100, vsbar
  text "Selected Nick", 3, 101 11 100 10
  edit "", 4, 101 22 100 10, disable
  text "Greet", 5, 101 44 100 10
  edit "", 6, 101 55 100 10, disable
  button "Save", 7, 101 77 49 10
  button "Delete", 8, 151 77 48 10, disable
  button "Ok", 9, 101 88 49 10, ok
  menu "Manage", 11
  item "New", 12, 11
  item "Exit", 13, 11
}

on *:DIALOG:greets:init:0: {
  var %i 1
  while (%i <= $var(%hi.*,0) ) {
    did -a greets 2 $gettok($var(%hi.*,%i),2,46)
    inc %i
  }
}

on *:DIALOG:greets:sclick:2: {
  did -ra greets 4 $did(2).seltext
  did -era greets 6 $var(%hi.*,$did(2).sel).value
  did -e greets 8-9
}

on *:DIALOG:greets:edit:6: {
  did -e greets 7
  did -era greets 8 Cancel
}

on *:DIALOG:greets:sclick:7: {
  set %hi. $+ $did(4) $did(6)
  did -b greets 7
  did -ra greets 8 Delete
}

on *:DIALOG:greets:sclick:8: {
  If ($did(8) == Delete) {
    unset %hi. $+ $did(4)
    dialog -x greets
    dialog -md greets greets
  }
  Else {
    did -ra greets 6 $var(%hi.*,$did(4)).value
    did -b greets 7
    did -ra greets 8 Delete
  }
}

on *:DIALOG:greets:menu:12: {
  set %hi. $+ $$?="Please input a nick." $?="Please input a greeting."
  dialog -x greets
  dialog -md greets greets
}

Comments

Sign in to comment.
Crissar   -  Mar 08, 2009

ya i read the modes few hours ago...well..te parametres even :D ..thnx for the input tho :D

 Respond  
Tamaki   -  Mar 07, 2009
item "Exit", 13, 11

change to

item "Exit", 13, 11, cancel

other than that it should still work fine...
you still have /dialog -md greets greets inside the dialog script. you only put /dialog -m greets greets in the menu option. I put -md so that it opens on the desktop (that way you don't have to close or move it to see behind it)

 Respond  
Crissar   -  Mar 07, 2009

1st of all...thanks @ Duelist for the dialog......
2nd....yes it is his
3rd....yes the :sclick: numbers are messed up BUT it works.
4th....yes i will fix it.
5th....thank you IF you rate/like

 Respond  
Tamaki   -  Mar 06, 2009

i put the kick & ban thing there just in case ;)
thanks for the review ^_^

 Respond  
Crissar   -  Mar 06, 2009

why put a k ban mode on it :S anyway its free to use dats why its on here...but ima give it anuda look/use :P im trying to make every remote work on its own.... :D nice one tho

 Respond  
Tamaki   -  Mar 06, 2009

um...i dunno if you'll like it
but i'm gonna use it if that's okay:

dialog greets {
  title Greets
  option dbu
  size -1 -1 200 111
  text "Nicks && Greet Messages", 1, 1 1 90 10
  list 2, 1 11 98 100, vsbar
  text "Selected Nick", 3, 101 11 100 10
  edit "", 4, 101 22 100 10, disable
  text "Greet Message", 5, 101 44 100 10
  edit "", 6, 101 55 100 10, disable
  button "Save", 7, 101 77 49 10, disable
  button "Delete", 8, 151 77 48 10, disable
  button "Kick", 9, 101 88 49 10, disable
  button "Ban", 10, 151 88 48 10, disable
  menu "Manage", 11
  item "New", 12
  item "Exit", 13, cancel
}

on *:DIALOG:greets:init:0: {
  var %i 1
  while (%i <= $var(%hi.*,0) ) {
    did -a greets 2 $gettok($var(%hi.*,%i),2,46)
    inc %i
  }
}

on *:DIALOG:greets:sclick:2: {
  did -ra greets 4 $did(2).seltext
  did -era greets 6 $var(%hi.*,$did(2).sel).value
  did -e greets 8-10
}

on *:DIALOG:greets:edit:6: {
  did -e greets 7
  did -era greets 8 Cancel
}

on *:DIALOG:greets:sclick:7: {
  set %hi. $+ $did(4) $did(6)
  did -b greets 7
  did -ra greets 8 Delete
}

on *:DIALOG:greets:sclick:8: {
  If ($did(8) == Delete) {
    unset %hi. $+ $did(4)
    dialog -x greets
    dialog -md greets greets
  }
  Else {
    did -ra greets 6 $var(%hi.*,$did(4)).value
    did -b greets 7
    did -ra greets 8 Delete
  }
}

on *:DIALOG:greets:sclick:9: {
  kick $active $did(4)
}

on *:DIALOG:greets:sclick:10: {
  .timer 1 1 /kick $active $did(4)
  ban $active $did(4)
}

on *:DIALOG:greets:menu:12: {
  set %hi. $+ $$?="Please input a nick." $?="Please input a greeting."
  dialog -x greets
  dialog -md greets greets
}
 Respond  
Crissar   -  Mar 06, 2009

I have the idea like this :
A list with the nicks that are already saved and on the right a EDIT button which will write the greet in ctrl format 12lawl hi nick under that there will be two buttons
Aplly and Cancel.Apply will save the changes done to the greet and cancel will erase any change you made and the original will be in the editbox again........maybe if that is not enuf ill add a delete button which will delete selected nick from the list and an add button that will use alias

 alias addhi {
  if ($1 != $null) {
    if (%hi. [ $+ [ $1 ] ] == $null) {
      set %hi. [ $+ [ $1 ] ] $$?="Your Greet Here:"
    }
    else { beep $input($+(Oh! $1 allready has a greet,$crlf,Edit your greets),o,Problem) }
  }
}

or??????

 Respond  
Crissar   -  Mar 06, 2009

Yes Aucun50 ...but im doing quite bad at dialogs yet...ill try update it...i need a dialog for the edit section... ://

 Respond  
Aucun50   -  Mar 05, 2009

You looking to make this into a dialog?

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.